Exemplo n.º 1
0
 /**
  * Filter the query by a related \ORM\Stock object
  *
  * @param \ORM\Stock|ObjectCollection $stock  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 filterByStock($stock, $comparison = null)
 {
     if ($stock instanceof \ORM\Stock) {
         return $this->addUsingAlias(ProductTableMap::COL_ID, $stock->getProductId(), $comparison);
     } elseif ($stock instanceof ObjectCollection) {
         return $this->useStockQuery()->filterByPrimaryKeys($stock->getPrimaryKeys())->endUse();
     } else {
         throw new PropelException('filterByStock() only accepts arguments of type \\ORM\\Stock or Collection');
     }
 }
Exemplo n.º 2
0
 /**
  * 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');
     }
 }
Exemplo n.º 3
0
 /**
  * Filter the query by a related \Thelia\Model\SaleProduct object
  *
  * @param \Thelia\Model\SaleProduct|ObjectCollection $saleProduct  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 filterBySaleProduct($saleProduct, $comparison = null)
 {
     if ($saleProduct instanceof \Thelia\Model\SaleProduct) {
         return $this->addUsingAlias(ProductTableMap::ID, $saleProduct->getProductId(), $comparison);
     } elseif ($saleProduct instanceof ObjectCollection) {
         return $this->useSaleProductQuery()->filterByPrimaryKeys($saleProduct->getPrimaryKeys())->endUse();
     } else {
         throw new PropelException('filterBySaleProduct() only accepts arguments of type \\Thelia\\Model\\SaleProduct or Collection');
     }
 }