Example #1
0
 /**
  * Filter the query by a related \App\Propel\ProductVariation object
  *
  * @param \App\Propel\ProductVariation|ObjectCollection $productVariation 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 ChildOrderProductQuery The current query, for fluid interface
  */
 public function filterByProductVariation($productVariation, $comparison = null)
 {
     if ($productVariation instanceof \App\Propel\ProductVariation) {
         return $this->addUsingAlias(OrderProductTableMap::COL_PRODUCT_VARIATION_ID, $productVariation->getProductVariationId(), $comparison);
     } elseif ($productVariation instanceof ObjectCollection) {
         if (null === $comparison) {
             $comparison = Criteria::IN;
         }
         return $this->addUsingAlias(OrderProductTableMap::COL_PRODUCT_VARIATION_ID, $productVariation->toKeyValue('PrimaryKey', 'ProductVariationId'), $comparison);
     } else {
         throw new PropelException('filterByProductVariation() only accepts arguments of type \\App\\Propel\\ProductVariation or Collection');
     }
 }
Example #2
0
 /**
  * Declares an association between this object and a ChildProductVariation object.
  *
  * @param  ChildProductVariation $v
  * @return $this|\App\Propel\OrderProduct The current object (for fluent API support)
  * @throws PropelException
  */
 public function setProductVariation(ChildProductVariation $v = null)
 {
     if ($v === null) {
         $this->setProductVariationId(NULL);
     } else {
         $this->setProductVariationId($v->getProductVariationId());
     }
     $this->aProductVariation = $v;
     // Add binding for other direction of this n:n relationship.
     // If this object has already been added to the ChildProductVariation object, it will not be re-added.
     if ($v !== null) {
         $v->addOrderProduct($this);
     }
     return $this;
 }
 /**
  * Exclude object from result
  *
  * @param   ChildProductVariation $productVariation Object to remove from the list of results
  *
  * @return $this|ChildProductVariationQuery The current query, for fluid interface
  */
 public function prune($productVariation = null)
 {
     if ($productVariation) {
         $this->addUsingAlias(ProductVariationTableMap::COL_PRODUCT_VARIATION_ID, $productVariation->getProductVariationId(), Criteria::NOT_EQUAL);
     }
     return $this;
 }