/** * Filter the query by a related Session object * * @param Session|PropelObjectCollection $session The related object(s) to use as filter * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return SingleSignOnKeyQuery 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(SingleSignOnKeyPeer::SESSION_ID, $session->getId(), $comparison); } elseif ($session instanceof PropelObjectCollection) { if (null === $comparison) { $comparison = Criteria::IN; } return $this->addUsingAlias(SingleSignOnKeyPeer::SESSION_ID, $session->toKeyValue('PrimaryKey', 'Id'), $comparison); } else { throw new PropelException('filterBySession() only accepts arguments of type Session or PropelCollection'); } }