Пример #1
0
 /**
  *
  * @param OnlineProduct $product
  *            Constructor
  */
 public function __construct(OnlineOrderProduct $product = null)
 {
     if (null != $product) {
         $this->label = $product->getLabel();
         $this->price = $product->getPrice();
         $this->vat = $product->getVat();
     } else {
         $this->price = 0;
         $this->vat = 0;
     }
     $this->dtCrea = new \DateTime('now');
 }
Пример #2
0
 /**
  * Add product
  *
  * @param OnlineOrderProduct $product
  *
  * @return OnlineOrder
  */
 public function addProduct(OnlineOrderProduct $product)
 {
     $product->setOrder($this);
     $this->products[] = $product;
     return $this;
 }
Пример #3
0
 /**
  * Add order
  *
  * @param OnlineOrderProduct $order
  *
  * @return OnlineProduct
  */
 public function addOrder(OnlineOrderProduct $order)
 {
     $order->setProduct($this);
     $this->orders[] = $order;
     return $this;
 }