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