/** * Remove issues of this object * through the R_rights_forissue cross reference table. * * @param ChildIssues $issues * @return ChildRights The current object (for fluent API support) */ public function removeIssues(ChildIssues $issues) { if ($this->getIssuess()->contains($issues)) { $rRightsForissue = new ChildRRightsForissue(); $rRightsForissue->setIssues($issues); if ($issues->isRightssLoaded()) { //remove the back reference if available $issues->getRightss()->removeObject($this); } $rRightsForissue->setRights($this); $this->removeRRightsForissue(clone $rRightsForissue); $rRightsForissue->clear(); $this->collIssuess->remove($this->collIssuess->search($issues)); if (null === $this->issuessScheduledForDeletion) { $this->issuessScheduledForDeletion = clone $this->collIssuess; $this->issuessScheduledForDeletion->clear(); } $this->issuessScheduledForDeletion->push($issues); } return $this; }