/** * @return OrderProducts */ public function getOrderProductModel() { if (null === $this->orderProductModel) { $orderProductModel = Order::where('session_id', $this->getId())->first()->products(); $this->setOrderProductModel($orderProductModel); } return $this->orderProductModel; }
/** * @return OrderDetail */ public function getOrderDetailModel() { if (null === $this->orderDetailModel) { $orderDetailModel = Order::where('session_id', $this->getId())->first()->detail; $this->setOrderDetailModel($orderDetailModel); } return $this->orderDetailModel; }
/** * @return OrderCustomer */ public function getOrderCustomerModel() { if (null === $this->orderCustomerModel) { $orderCustomerModel = Order::where('session_id', $this->getId())->first()->customer; $this->setOrderCustomerModel($orderCustomerModel); } return $this->orderCustomerModel; }
/** * @param int $orderId * @return mixed */ public function getOrder(int $orderId = 0) { return Order::find($orderId); }