/** * Filter the query by a related Transaction object * * @param Transaction|PropelObjectCollection $transaction the related object to use as filter * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return ProductQuery The current query, for fluid interface * @throws PropelException - if the provided filter is invalid. */ public function filterByTransaction($transaction, $comparison = null) { if ($transaction instanceof Transaction) { return $this->addUsingAlias(ProductPeer::ID, $transaction->getProductId(), $comparison); } elseif ($transaction instanceof PropelObjectCollection) { return $this->useTransactionQuery()->filterByPrimaryKeys($transaction->getPrimaryKeys())->endUse(); } else { throw new PropelException('filterByTransaction() only accepts arguments of type Transaction or PropelCollection'); } }