Example #1
0
 /**
  * Filter the query by a related Watchlist object
  *
  * @param   Watchlist|PropelObjectCollection $watchlist  the related object to use as filter
  * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return   UserQuery The current query, for fluid interface
  * @throws   PropelException - if the provided filter is invalid.
  */
 public function filterByWatchlist($watchlist, $comparison = null)
 {
     if ($watchlist instanceof Watchlist) {
         return $this->addUsingAlias(UserPeer::ID, $watchlist->getUserId(), $comparison);
     } elseif ($watchlist instanceof PropelObjectCollection) {
         return $this->useWatchlistQuery()->filterByPrimaryKeys($watchlist->getPrimaryKeys())->endUse();
     } else {
         throw new PropelException('filterByWatchlist() only accepts arguments of type Watchlist or PropelCollection');
     }
 }