Exemplo n.º 1
0
 /**
  * Clears the current object, sets all attributes to their default values and removes
  * outgoing references as well as back-references (from other objects to this one. Results probably in a database
  * change of those foreign objects when you call `save` there).
  */
 public function clear()
 {
     if (null !== $this->aOrder) {
         $this->aOrder->removeOrderProduct($this);
     }
     if (null !== $this->aProduct) {
         $this->aProduct->removeOrderProduct($this);
     }
     if (null !== $this->aProductVariation) {
         $this->aProductVariation->removeOrderProduct($this);
     }
     $this->order_product_id = null;
     $this->order_id = null;
     $this->product_id = null;
     $this->product_variation_id = null;
     $this->product_quantity = null;
     $this->created_at = null;
     $this->updated_at = null;
     $this->alreadyInSave = false;
     $this->clearAllReferences();
     $this->resetModified();
     $this->setNew(true);
     $this->setDeleted(false);
 }
Exemplo n.º 2
0
 /**
  * Filter the query by a related \App\Propel\Order object
  *
  * @param \App\Propel\Order|ObjectCollection $order 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 filterByOrder($order, $comparison = null)
 {
     if ($order instanceof \App\Propel\Order) {
         return $this->addUsingAlias(OrderProductTableMap::COL_ORDER_ID, $order->getOrderId(), $comparison);
     } elseif ($order instanceof ObjectCollection) {
         if (null === $comparison) {
             $comparison = Criteria::IN;
         }
         return $this->addUsingAlias(OrderProductTableMap::COL_ORDER_ID, $order->toKeyValue('PrimaryKey', 'OrderId'), $comparison);
     } else {
         throw new PropelException('filterByOrder() only accepts arguments of type \\App\\Propel\\Order or Collection');
     }
 }
Exemplo n.º 3
0
 /**
  * Exclude object from result
  *
  * @param   ChildOrder $order Object to remove from the list of results
  *
  * @return $this|ChildOrderQuery The current query, for fluid interface
  */
 public function prune($order = null)
 {
     if ($order) {
         $this->addUsingAlias(OrderTableMap::COL_ORDER_ID, $order->getOrderId(), Criteria::NOT_EQUAL);
     }
     return $this;
 }
Exemplo n.º 4
0
 /**
  * @param ChildOrder $order The ChildOrder object to add.
  */
 protected function doAddOrder(ChildOrder $order)
 {
     $this->collOrders[] = $order;
     $order->setUser($this);
 }
Exemplo n.º 5
0
 /**
  * Filter the query by a related \App\Propel\Order object
  *
  * @param \App\Propel\Order|ObjectCollection $order the related object to use as filter
  * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return ChildDeliveryQuery The current query, for fluid interface
  */
 public function filterByOrder($order, $comparison = null)
 {
     if ($order instanceof \App\Propel\Order) {
         return $this->addUsingAlias(DeliveryTableMap::COL_DELIVERY_ID, $order->getDeliveryId(), $comparison);
     } elseif ($order instanceof ObjectCollection) {
         return $this->useOrderQuery()->filterByPrimaryKeys($order->getPrimaryKeys())->endUse();
     } else {
         throw new PropelException('filterByOrder() only accepts arguments of type \\App\\Propel\\Order or Collection');
     }
 }