Example #1
0
 /**
  * Filter the query by a related \Models\Article object
  *
  * @param \Models\Article|ObjectCollection $article The related object(s) to use as filter
  * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @throws \Propel\Runtime\Exception\PropelException
  *
  * @return ChildCommentQuery The current query, for fluid interface
  */
 public function filterByArticle($article, $comparison = null)
 {
     if ($article instanceof \Models\Article) {
         return $this->addUsingAlias(CommentTableMap::COL_ID_ARTICLE, $article->getId(), $comparison);
     } elseif ($article instanceof ObjectCollection) {
         if (null === $comparison) {
             $comparison = Criteria::IN;
         }
         return $this->addUsingAlias(CommentTableMap::COL_ID_ARTICLE, $article->toKeyValue('PrimaryKey', 'Id'), $comparison);
     } else {
         throw new PropelException('filterByArticle() only accepts arguments of type \\Models\\Article or Collection');
     }
 }