/** * Filter the query by a related \App\Propel\Product object * * @param \App\Propel\Product|ObjectCollection $product The related object(s) to use as filter * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @throws \Propel\Runtime\Exception\PropelException * * @return ChildProductHighlightedQuery The current query, for fluid interface */ public function filterByProduct($product, $comparison = null) { if ($product instanceof \App\Propel\Product) { return $this->addUsingAlias(ProductHighlightedTableMap::COL_PRODUCT_ID, $product->getProductId(), $comparison); } elseif ($product instanceof ObjectCollection) { if (null === $comparison) { $comparison = Criteria::IN; } return $this->addUsingAlias(ProductHighlightedTableMap::COL_PRODUCT_ID, $product->toKeyValue('PrimaryKey', 'ProductId'), $comparison); } else { throw new PropelException('filterByProduct() only accepts arguments of type \\App\\Propel\\Product or Collection'); } }