Esempio n. 1
0
 /**
  * Filter the query by a related \App\Propel\News object
  *
  * @param \App\Propel\News|ObjectCollection $news the related object to use as filter
  * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return ChildFileQuery The current query, for fluid interface
  */
 public function filterByNews($news, $comparison = null)
 {
     if ($news instanceof \App\Propel\News) {
         return $this->addUsingAlias(FileTableMap::COL_FILE_ID, $news->getNewsPic(), $comparison);
     } elseif ($news instanceof ObjectCollection) {
         return $this->useNewsQuery()->filterByPrimaryKeys($news->getPrimaryKeys())->endUse();
     } else {
         throw new PropelException('filterByNews() only accepts arguments of type \\App\\Propel\\News or Collection');
     }
 }