/** * Remove rights of this object * through the R_rights_forbook cross reference table. * * @param ChildRights $rights * @return ChildBooks The current object (for fluent API support) */ public function removeRights(ChildRights $rights) { if ($this->getRightss()->contains($rights)) { $rRightsForbook = new ChildRRightsForbook(); $rRightsForbook->setRights($rights); if ($rights->isBookssLoaded()) { //remove the back reference if available $rights->getBookss()->removeObject($this); } $rRightsForbook->setBooks($this); $this->removeRRightsForbook(clone $rRightsForbook); $rRightsForbook->clear(); $this->collRightss->remove($this->collRightss->search($rights)); if (null === $this->rightssScheduledForDeletion) { $this->rightssScheduledForDeletion = clone $this->collRightss; $this->rightssScheduledForDeletion->clear(); } $this->rightssScheduledForDeletion->push($rights); } return $this; }
/** * Filter the query by a related \RRightsForbook object * * @param \RRightsForbook|ObjectCollection $rRightsForbook the related object to use as filter * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return ChildBooksQuery The current query, for fluid interface */ public function filterByRRightsForbook($rRightsForbook, $comparison = null) { if ($rRightsForbook instanceof \RRightsForbook) { return $this->addUsingAlias(BooksTableMap::COL_ID, $rRightsForbook->getBookid(), $comparison); } elseif ($rRightsForbook instanceof ObjectCollection) { return $this->useRRightsForbookQuery()->filterByPrimaryKeys($rRightsForbook->getPrimaryKeys())->endUse(); } else { throw new PropelException('filterByRRightsForbook() only accepts arguments of type \\RRightsForbook or Collection'); } }
/** * Exclude object from result * * @param ChildRRightsForbook $rRightsForbook Object to remove from the list of results * * @return $this|ChildRRightsForbookQuery The current query, for fluid interface */ public function prune($rRightsForbook = null) { if ($rRightsForbook) { $this->addCond('pruneCond0', $this->getAliasedColName(RRightsForbookTableMap::COL__RIGHTID), $rRightsForbook->getRightid(), Criteria::NOT_EQUAL); $this->addCond('pruneCond1', $this->getAliasedColName(RRightsForbookTableMap::COL__BOOKID), $rRightsForbook->getBookid(), Criteria::NOT_EQUAL); $this->combine(array('pruneCond0', 'pruneCond1'), Criteria::LOGICAL_OR); } return $this; }