/** * Filter the query by a related \Thelia\Model\ProductImage object * * @param \Thelia\Model\ProductImage|ObjectCollection $productImage The related object(s) to use as filter * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return ChildProductSaleElementsProductImageQuery The current query, for fluid interface */ public function filterByProductImage($productImage, $comparison = null) { if ($productImage instanceof \Thelia\Model\ProductImage) { return $this->addUsingAlias(ProductSaleElementsProductImageTableMap::PRODUCT_IMAGE_ID, $productImage->getId(), $comparison); } elseif ($productImage instanceof ObjectCollection) { if (null === $comparison) { $comparison = Criteria::IN; } return $this->addUsingAlias(ProductSaleElementsProductImageTableMap::PRODUCT_IMAGE_ID, $productImage->toKeyValue('PrimaryKey', 'Id'), $comparison); } else { throw new PropelException('filterByProductImage() only accepts arguments of type \\Thelia\\Model\\ProductImage or Collection'); } }
/** * Declares an association between this object and a ChildProductImage object. * * @param ChildProductImage $v * @return \Thelia\Model\ProductSaleElementsProductImage The current object (for fluent API support) * @throws PropelException */ public function setProductImage(ChildProductImage $v = null) { if ($v === null) { $this->setProductImageId(NULL); } else { $this->setProductImageId($v->getId()); } $this->aProductImage = $v; // Add binding for other direction of this n:n relationship. // If this object has already been added to the ChildProductImage object, it will not be re-added. if ($v !== null) { $v->addProductSaleElementsProductImage($this); } return $this; }
/** * Exclude object from result * * @param ChildProductImage $productImage Object to remove from the list of results * * @return ChildProductImageQuery The current query, for fluid interface */ public function prune($productImage = null) { if ($productImage) { $this->addUsingAlias(ProductImageTableMap::ID, $productImage->getId(), Criteria::NOT_EQUAL); } return $this; }