Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
OrderPlugin.php
Go to the documentation of this file.
1 <?php
7 
11 
18 {
22  private $guaranteeCancelingService;
23 
27  public function __construct(
28  GuaranteeCancelingServiceInterface $guaranteeCancelingService
29  ) {
30  $this->guaranteeCancelingService = $guaranteeCancelingService;
31  }
32 
42  public function afterCancel(Order $order, $result)
43  {
44  if ($order->isCanceled()) {
45  $this->guaranteeCancelingService->cancelForOrder(
46  $order->getEntityId()
47  );
48  }
49 
50  return $result;
51  }
52 }
__construct(GuaranteeCancelingServiceInterface $guaranteeCancelingService)
Definition: OrderPlugin.php:27
afterCancel(Order $order, $result)
Definition: OrderPlugin.php:42
$order
Definition: order.php:55