/** * Filter the query by a related Person object * * @param Person|PropelObjectCollection $person The related object(s) to use as filter * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return FriendQuery The current query, for fluid interface * @throws PropelException - if the provided filter is invalid. */ public function filterByPersonRelatedByPerson2($person, $comparison = null) { if ($person instanceof Person) { return $this->addUsingAlias(FriendPeer::PERSON_2, $person->getId(), $comparison); } elseif ($person instanceof PropelObjectCollection) { if (null === $comparison) { $comparison = Criteria::IN; } return $this->addUsingAlias(FriendPeer::PERSON_2, $person->toKeyValue('PrimaryKey', 'Id'), $comparison); } else { throw new PropelException('filterByPersonRelatedByPerson2() only accepts arguments of type Person or PropelCollection'); } }