Esempio n. 1
0
 public function saveOrdersProducts()
 {
     $ordersProducts = new OrdersProducts();
     $ordersProducts->order_id = $this->orderId;
     $ordersProducts->product_id = $this->productId;
     $ordersProducts->price = $this->price;
     $ordersProducts->quantity = $this->quantity;
     return $ordersProducts->save(false) && !$this->hasErrors() ? $ordersProducts : null;
 }
Esempio n. 2
0
 public function getDetails()
 {
     return $this->hasMany(OrdersProducts::className(), ['order_id' => 'id']);
 }