/** * Invoke service * * @param int $id * @param \Magento\Sales\Service\V1\Data\OrderStatusHistory $statusHistory * @return bool */ public function invoke($id, OrderStatusHistory $statusHistory) { $order = $this->orderRepository->get($id); $order->addStatusHistory($this->historyConverter->getModel($statusHistory)); $order->save(); return true; }
/** * {@inheritdoc} */ public function get($id) { $pluginInfo = $this->pluginList->getNext($this->subjectType, 'get'); if (!$pluginInfo) { return parent::get($id); } else { return $this->___callPlugins('get', func_get_args(), $pluginInfo); } }
/** * Invoke getOrder service * * @param int $id * @return \Magento\Sales\Service\V1\Data\Order * @throws \Magento\Framework\Exception\NoSuchEntityException */ public function invoke($id) { return $this->orderMapper->extractDto($this->orderRepository->get($id)); }
/** * Invoke orderHold service * * @param int $id * @return bool * @throws \Magento\Framework\Exception\NoSuchEntityException */ public function invoke($id) { return (bool) $this->orderRepository->get($id)->hold(); }
/** * Invoke notifyUser service * * @param int $id * @return bool */ public function invoke($id) { /** @var \Magento\Sales\Model\Order $order */ $order = $this->orderRepository->get($id); return $this->notifier->notify($order); }
/** * Retrieve order status by id * * @param int $id * @return string * @throws \Magento\Framework\Exception\NoSuchEntityException */ public function invoke($id) { return $this->orderRepository->get($id)->getStatus(); }