Example #1
0
 /**
  * Filter the query by a related \Models\Article object
  *
  * @param \Models\Article|ObjectCollection $article 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 filterByArticle($article, $comparison = null)
 {
     if ($article instanceof \Models\Article) {
         return $this->addUsingAlias(CategoryTableMap::COL_ID, $article->getIdCategory(), $comparison);
     } elseif ($article instanceof ObjectCollection) {
         return $this->useArticleQuery()->filterByPrimaryKeys($article->getPrimaryKeys())->endUse();
     } else {
         throw new PropelException('filterByArticle() only accepts arguments of type \\Models\\Article or Collection');
     }
 }