/** * Filter the query by a related \Thelia\Model\ProductImage object * * @param \Thelia\Model\ProductImage|ObjectCollection $productImage the related object to use as filter * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return ChildProductQuery The current query, for fluid interface */ public function filterByProductImage($productImage, $comparison = null) { if ($productImage instanceof \Thelia\Model\ProductImage) { return $this->addUsingAlias(ProductTableMap::ID, $productImage->getProductId(), $comparison); } elseif ($productImage instanceof ObjectCollection) { return $this->useProductImageQuery()->filterByPrimaryKeys($productImage->getPrimaryKeys())->endUse(); } else { throw new PropelException('filterByProductImage() only accepts arguments of type \\Thelia\\Model\\ProductImage or Collection'); } }