/** * Filter the query by a related \ORM\PurchaseHistory object * * @param \ORM\PurchaseHistory|ObjectCollection $purchaseHistory the related object 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 filterByHistory($purchaseHistory, $comparison = null) { if ($purchaseHistory instanceof \ORM\PurchaseHistory) { return $this->addUsingAlias(PurchaseTableMap::COL_ID, $purchaseHistory->getPurchaseId(), $comparison); } elseif ($purchaseHistory instanceof ObjectCollection) { return $this->useHistoryQuery()->filterByPrimaryKeys($purchaseHistory->getPrimaryKeys())->endUse(); } else { throw new PropelException('filterByHistory() only accepts arguments of type \\ORM\\PurchaseHistory or Collection'); } }