You are here

class OrderAssignEvent in Commerce Core 8.2

Defines the order assign event.

Hierarchy

  • class \Drupal\commerce\EventBase extends \Drupal\Component\EventDispatcher\Event

Expanded class hierarchy of OrderAssignEvent

See also

\Drupal\commerce_order\Event\OrderEvents

4 files declare their use of OrderAssignEvent
AddressBookSubscriber.php in modules/order/src/EventSubscriber/AddressBookSubscriber.php
OrderAssignment.php in modules/order/src/OrderAssignment.php
OrderAssignSubscriber.php in modules/payment/src/EventSubscriber/OrderAssignSubscriber.php
OrderEventSubscriber.php in modules/log/src/EventSubscriber/OrderEventSubscriber.php

File

modules/order/src/Event/OrderAssignEvent.php, line 14

Namespace

Drupal\commerce_order\Event
View source
class OrderAssignEvent extends EventBase {

  /**
   * The order.
   *
   * @var \Drupal\commerce_order\Entity\OrderInterface
   */
  protected $order;

  /**
   * The customer.
   *
   * @var \Drupal\user\UserInterface
   */
  protected $customer;

  /**
   * Constructs a new OrderAssignEvent.
   *
   * @param \Drupal\commerce_order\Entity\OrderInterface $order
   *   The order.
   * @param \Drupal\user\UserInterface $customer
   *   The customer.
   */
  public function __construct(OrderInterface $order, UserInterface $customer) {
    $this->order = $order;
    $this->customer = $customer;
  }

  /**
   * Gets the order.
   *
   * @return \Drupal\commerce_order\Entity\OrderInterface
   *   The order.
   */
  public function getOrder() {
    return $this->order;
  }

  /**
   * Gets the customer.
   *
   * @return \Drupal\user\UserInterface
   *   The customer.
   */
  public function getCustomer() {
    return $this->customer;
  }

  /**
   * Gets the user account.
   *
   * @deprecated Use getCustomer() instead.
   *
   * @return \Drupal\user\UserInterface
   *   The user account.
   */
  public function getAccount() {
    return $this
      ->getCustomer();
  }

}

Members

Namesort descending Modifiers Type Description Overrides
OrderAssignEvent::$customer protected property The customer.
OrderAssignEvent::$order protected property The order.
OrderAssignEvent::getAccount Deprecated public function Gets the user account.
OrderAssignEvent::getCustomer public function Gets the customer.
OrderAssignEvent::getOrder public function Gets the order.
OrderAssignEvent::__construct public function Constructs a new OrderAssignEvent.