You are here

class CustomerProfileEvent in Commerce Core 8.2

Defines the customer profile event.

Hierarchy

Expanded class hierarchy of CustomerProfileEvent

See also

\Drupal\commerce_tax\Event\TaxEvents

1 file declares its use of CustomerProfileEvent
TaxTypeBase.php in modules/tax/src/Plugin/Commerce/TaxType/TaxTypeBase.php

File

modules/tax/src/Event/CustomerProfileEvent.php, line 14

Namespace

Drupal\commerce_tax\Event
View source
class CustomerProfileEvent extends EventBase {

  /**
   * The customer profile.
   *
   * @var \Drupal\profile\Entity\ProfileInterface
   */
  protected $customerProfile;

  /**
   * The order item.
   *
   * @var \Drupal\commerce_order\Entity\OrderItemInterface
   */
  protected $orderItem;

  /**
   * Constructs a new CustomerProfileEvent.
   *
   * @param \Drupal\profile\Entity\ProfileInterface $customer_profile
   *   The initially selected customer profile.
   * @param \Drupal\commerce_order\Entity\OrderItemInterface $order_item
   *   The order item.
   */
  public function __construct(ProfileInterface $customer_profile = NULL, OrderItemInterface $order_item) {
    $this->customerProfile = $customer_profile;
    $this->orderItem = $order_item;
  }

  /**
   * Gets the customer profile.
   *
   * @return \Drupal\profile\Entity\ProfileInterface|null
   *   The customer profile, or NULL if not yet known.
   */
  public function getCustomerProfile() {
    return $this->customerProfile;
  }

  /**
   * Sets the customer profile.
   *
   * @param \Drupal\profile\Entity\ProfileInterface $customer_profile
   *   The customer profile.
   *
   * @return $this
   */
  public function setCustomerProfile(ProfileInterface $customer_profile) {
    $this->customerProfile = $customer_profile;
    return $this;
  }

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

}

Members

Namesort descending Modifiers Type Description Overrides
CustomerProfileEvent::$customerProfile protected property The customer profile.
CustomerProfileEvent::$orderItem protected property The order item.
CustomerProfileEvent::getCustomerProfile public function Gets the customer profile.
CustomerProfileEvent::getOrderItem public function Gets the order item.
CustomerProfileEvent::setCustomerProfile public function Sets the customer profile.
CustomerProfileEvent::__construct public function Constructs a new CustomerProfileEvent.