Example #1
0
 /**
  * Filter the query by a related Session object
  *
  * @param   Session|PropelObjectCollection $session  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 filterBySession($session, $comparison = null)
 {
     if ($session instanceof Session) {
         return $this->addUsingAlias(UserPeer::ID, $session->getUserId(), $comparison);
     } elseif ($session instanceof PropelObjectCollection) {
         return $this->useSessionQuery()->filterByPrimaryKeys($session->getPrimaryKeys())->endUse();
     } else {
         throw new PropelException('filterBySession() only accepts arguments of type Session or PropelCollection');
     }
 }