예제 #1
0
 /**
  * Filter the query by a related \News object
  *
  * @param \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 ChildUserQuery The current query, for fluid interface
  */
 public function filterByNews($news, $comparison = null)
 {
     if ($news instanceof \News) {
         return $this->addUsingAlias(UserTableMap::COL_ID, $news->getUserId(), $comparison);
     } elseif ($news instanceof ObjectCollection) {
         return $this->useNewsQuery()->filterByPrimaryKeys($news->getPrimaryKeys())->endUse();
     } else {
         throw new PropelException('filterByNews() only accepts arguments of type \\News or Collection');
     }
 }
예제 #2
0
파일: NewsQuery.php 프로젝트: nirkbirk/site
 /**
  * Exclude object from result
  *
  * @param   ChildNews $news Object to remove from the list of results
  *
  * @return $this|ChildNewsQuery The current query, for fluid interface
  */
 public function prune($news = null)
 {
     if ($news) {
         $this->addUsingAlias(NewsTableMap::COL_ID, $news->getId(), Criteria::NOT_EQUAL);
     }
     return $this;
 }
예제 #3
0
파일: User.php 프로젝트: nirkbirk/site
 /**
  * @param ChildNews $news The ChildNews object to add.
  */
 protected function doAddNews(ChildNews $news)
 {
     $this->collNews[] = $news;
     $news->setUser($this);
 }