class CustomerProfileEvent in Commerce Core 8.2
Defines the customer profile event.
Hierarchy
- class \Drupal\commerce\EventBase extends \Drupal\Component\EventDispatcher\Event
- class \Drupal\commerce_tax\Event\CustomerProfileEvent
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\EventView 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
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
CustomerProfileEvent:: |
protected | property | The customer profile. | |
CustomerProfileEvent:: |
protected | property | The order item. | |
CustomerProfileEvent:: |
public | function | Gets the customer profile. | |
CustomerProfileEvent:: |
public | function | Gets the order item. | |
CustomerProfileEvent:: |
public | function | Sets the customer profile. | |
CustomerProfileEvent:: |
public | function | Constructs a new CustomerProfileEvent. |