Exemplo 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 ChildResourceQuery The current query, for fluid interface
  */
 public function filterByNewsRelatedByNewsFor($news, $comparison = null)
 {
     if ($news instanceof \App\Propel\News) {
         return $this->addUsingAlias(ResourceTableMap::COL_RESOURCE_ID, $news->getNewsFor(), $comparison);
     } elseif ($news instanceof ObjectCollection) {
         return $this->useNewsRelatedByNewsForQuery()->filterByPrimaryKeys($news->getPrimaryKeys())->endUse();
     } else {
         throw new PropelException('filterByNewsRelatedByNewsFor() only accepts arguments of type \\App\\Propel\\News or Collection');
     }
 }