You are here

public function OrderEventSubscriber::onOrderAssign in Commerce Core 8.2

Creates a log when an order is assigned.

Parameters

\Drupal\commerce_order\Event\OrderAssignEvent $event: The order assign event.

File

modules/log/src/EventSubscriber/OrderEventSubscriber.php, line 45

Class

OrderEventSubscriber

Namespace

Drupal\commerce_log\EventSubscriber

Code

public function onOrderAssign(OrderAssignEvent $event) {
  $order = $event
    ->getOrder();
  $this->logStorage
    ->generate($order, 'order_assigned', [
    'user' => $event
      ->getCustomer()
      ->getDisplayName(),
  ])
    ->save();
}