示例#1
0
 /**
  * Filter the query by a related ContentObject object
  *
  * @param   ContentObject|PropelObjectCollection $contentObject  the related object to use as filter
  * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return                 PageQuery The current query, for fluid interface
  * @throws PropelException - if the provided filter is invalid.
  */
 public function filterByContentObject($contentObject, $comparison = null)
 {
     if ($contentObject instanceof ContentObject) {
         return $this->addUsingAlias(PagePeer::ID, $contentObject->getPageId(), $comparison);
     } elseif ($contentObject instanceof PropelObjectCollection) {
         return $this->useContentObjectQuery()->filterByPrimaryKeys($contentObject->getPrimaryKeys())->endUse();
     } else {
         throw new PropelException('filterByContentObject() only accepts arguments of type ContentObject or PropelCollection');
     }
 }