Exemplo n.º 1
0
 /**
  * Filter the query by a related User object
  *
  * @param   User|PropelObjectCollection $user  the related object to use as filter
  * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return                 AccountQuery The current query, for fluid interface
  * @throws PropelException - if the provided filter is invalid.
  */
 public function filterByUser($user, $comparison = null)
 {
     if ($user instanceof User) {
         return $this->addUsingAlias(AccountPeer::ID, $user->getAccountId(), $comparison);
     } elseif ($user instanceof PropelObjectCollection) {
         return $this->useUserQuery()->filterByPrimaryKeys($user->getPrimaryKeys())->endUse();
     } else {
         throw new PropelException('filterByUser() only accepts arguments of type User or PropelCollection');
     }
 }