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; }
public function getDetails() { return $this->hasMany(OrdersProducts::className(), ['order_id' => 'id']); }