コード例 #1
0
 /**
  * Filter the query by a related Category object
  *
  * @param     Category $category  the related object to use as filter
  * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return    UserQuery The current query, for fluid interface
  */
 public function filterByCategory($category, $comparison = null)
 {
     if ($category instanceof Category) {
         return $this->addUsingAlias(UserPeer::ID, $category->getUserId(), $comparison);
     } elseif ($category instanceof PropelCollection) {
         return $this->useCategoryQuery()->filterByPrimaryKeys($category->getPrimaryKeys())->endUse();
     } else {
         throw new PropelException('filterByCategory() only accepts arguments of type Category or PropelCollection');
     }
 }