コード例 #1
0
ファイル: CategoryQuery.php プロジェクト: alex63530/thelia
 /**
  * Filter the query by a related \Thelia\Model\CategoryDocument object
  *
  * @param \Thelia\Model\CategoryDocument|ObjectCollection $categoryDocument  the related object to use as filter
  * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return ChildCategoryQuery The current query, for fluid interface
  */
 public function filterByCategoryDocument($categoryDocument, $comparison = null)
 {
     if ($categoryDocument instanceof \Thelia\Model\CategoryDocument) {
         return $this->addUsingAlias(CategoryTableMap::ID, $categoryDocument->getCategoryId(), $comparison);
     } elseif ($categoryDocument instanceof ObjectCollection) {
         return $this->useCategoryDocumentQuery()->filterByPrimaryKeys($categoryDocument->getPrimaryKeys())->endUse();
     } else {
         throw new PropelException('filterByCategoryDocument() only accepts arguments of type \\Thelia\\Model\\CategoryDocument or Collection');
     }
 }