/** * Filter the query by a related \ORM\SecondParty object * * @param \ORM\SecondParty|ObjectCollection $secondParty The related object(s) to use as filter * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return ChildPurchaseQuery The current query, for fluid interface */ public function filterBySecondParty($secondParty, $comparison = null) { if ($secondParty instanceof \ORM\SecondParty) { return $this->addUsingAlias(PurchaseTableMap::COL_SECOND_PARTY_ID, $secondParty->getId(), $comparison); } elseif ($secondParty instanceof ObjectCollection) { if (null === $comparison) { $comparison = Criteria::IN; } return $this->addUsingAlias(PurchaseTableMap::COL_SECOND_PARTY_ID, $secondParty->toKeyValue('PrimaryKey', 'Id'), $comparison); } else { throw new PropelException('filterBySecondParty() only accepts arguments of type \\ORM\\SecondParty or Collection'); } }