コード例 #1
0
ファイル: RightsQuery.php プロジェクト: Rokfor/rokfor-php-db
 /**
  * Filter the query by a related \RRightsFortemplate object
  *
  * @param \RRightsFortemplate|ObjectCollection $rRightsFortemplate the related object to use as filter
  * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return ChildRightsQuery The current query, for fluid interface
  */
 public function filterByRRightsFortemplate($rRightsFortemplate, $comparison = null)
 {
     if ($rRightsFortemplate instanceof \RRightsFortemplate) {
         return $this->addUsingAlias(RightsTableMap::COL_ID, $rRightsFortemplate->getRightid(), $comparison);
     } elseif ($rRightsFortemplate instanceof ObjectCollection) {
         return $this->useRRightsFortemplateQuery()->filterByPrimaryKeys($rRightsFortemplate->getPrimaryKeys())->endUse();
     } else {
         throw new PropelException('filterByRRightsFortemplate() only accepts arguments of type \\RRightsFortemplate or Collection');
     }
 }
コード例 #2
0
 /**
  * Remove rights of this object
  * through the R_rights_fortemplate cross reference table.
  *
  * @param ChildRights $rights
  * @return ChildTemplatenames The current object (for fluent API support)
  */
 public function removeRights(ChildRights $rights)
 {
     if ($this->getRightss()->contains($rights)) {
         $rRightsFortemplate = new ChildRRightsFortemplate();
         $rRightsFortemplate->setRights($rights);
         if ($rights->isTemplatenamessLoaded()) {
             //remove the back reference if available
             $rights->getTemplatenamess()->removeObject($this);
         }
         $rRightsFortemplate->setTemplatenames($this);
         $this->removeRRightsFortemplate(clone $rRightsFortemplate);
         $rRightsFortemplate->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;
 }
コード例 #3
0
 /**
  * Exclude object from result
  *
  * @param   ChildRRightsFortemplate $rRightsFortemplate Object to remove from the list of results
  *
  * @return $this|ChildRRightsFortemplateQuery The current query, for fluid interface
  */
 public function prune($rRightsFortemplate = null)
 {
     if ($rRightsFortemplate) {
         $this->addCond('pruneCond0', $this->getAliasedColName(RRightsFortemplateTableMap::COL__RIGHTID), $rRightsFortemplate->getRightid(), Criteria::NOT_EQUAL);
         $this->addCond('pruneCond1', $this->getAliasedColName(RRightsFortemplateTableMap::COL__TEMPLATEID), $rRightsFortemplate->getTemplateid(), Criteria::NOT_EQUAL);
         $this->combine(array('pruneCond0', 'pruneCond1'), Criteria::LOGICAL_OR);
     }
     return $this;
 }