Пример #1
0
 /**
  * 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;
 }
Пример #2
0
 /**
  * {@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);
     }
 }
Пример #3
0
 /**
  * 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));
 }
Пример #4
0
 /**
  * Invoke orderHold service
  *
  * @param int $id
  * @return bool
  * @throws \Magento\Framework\Exception\NoSuchEntityException
  */
 public function invoke($id)
 {
     return (bool) $this->orderRepository->get($id)->hold();
 }
Пример #5
0
 /**
  * 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);
 }
Пример #6
0
 /**
  * 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();
 }