/** * Remove books of this object * through the R_templatenames_forbook cross reference table. * * @param ChildBooks $books * @return ChildTemplatenames The current object (for fluent API support) */ public function removeBooks(ChildBooks $books) { if ($this->getBookss()->contains($books)) { $rTemplatenamesForbook = new ChildRTemplatenamesForbook(); $rTemplatenamesForbook->setBooks($books); if ($books->isTemplatenamessLoaded()) { //remove the back reference if available $books->getTemplatenamess()->removeObject($this); } $rTemplatenamesForbook->setTemplatenames($this); $this->removeRTemplatenamesForbook(clone $rTemplatenamesForbook); $rTemplatenamesForbook->clear(); $this->collBookss->remove($this->collBookss->search($books)); if (null === $this->bookssScheduledForDeletion) { $this->bookssScheduledForDeletion = clone $this->collBookss; $this->bookssScheduledForDeletion->clear(); } $this->bookssScheduledForDeletion->push($books); } return $this; }
/** * @param ChildBooks $books The ChildBooks object to remove. * @return $this|ChildUsers The current object (for fluent API support) */ public function removeBooks(ChildBooks $books) { if ($this->getBookss()->contains($books)) { $pos = $this->collBookss->search($books); $this->collBookss->remove($pos); if (null === $this->bookssScheduledForDeletion) { $this->bookssScheduledForDeletion = clone $this->collBookss; $this->bookssScheduledForDeletion->clear(); } $this->bookssScheduledForDeletion[] = $books; $books->setuserSysRef(null); } return $this; }