class BeforePackEvent in Commerce FedEx 8
Defines the before pack event for FedEx.
@todo Remove this event after it's rolled into commerce_shipping
Hierarchy
- class \Drupal\commerce_fedex\Event\BeforePackEvent extends \Symfony\Component\EventDispatcher\Event
Expanded class hierarchy of BeforePackEvent
See also
\Drupal\commerce_fedex\Event\CommerceFedExEvents
1 file declares its use of BeforePackEvent
- CommerceFedExPacker.php in src/
Packer/ CommerceFedExPacker.php
File
- src/
Event/ BeforePackEvent.php, line 16
Namespace
Drupal\commerce_fedex\EventView source
class BeforePackEvent extends Event {
/**
* The order items being packed.
*
* @var \Drupal\commerce_order\Entity\OrderItemInterface[]
*/
protected $orderItems;
/**
* The order being packed.
*
* @var \Drupal\commerce_order\Entity\OrderInterface
*/
protected $order;
/**
* The selected shipping profile.
*
* @var \Drupal\profile\Entity\ProfileInterface
*/
protected $shippingProfile;
/**
* Constructs a new BeforePackEvent object.
*
* @param array $order_items
* The order items array.
* @param \Drupal\commerce_order\Entity\OrderInterface $order
* The order being packed.
* @param \Drupal\profile\Entity\ProfileInterface $shipping_profile
* The selected shipping profile.
*/
public function __construct(array $order_items, OrderInterface $order, ProfileInterface $shipping_profile) {
$this->orderItems = $order_items;
$this->order = $order;
$this->shippingProfile = $shipping_profile;
}
/**
* Gets the order items.
*
* @return \Drupal\commerce_order\Entity\OrderItemInterface[]
* The order items.
*/
public function getOrderItems() {
return $this->orderItems;
}
/**
* Sets the plugin types.
*
* @param array $order_items
* The order items array.
*
* @return $this
*/
public function setOrderItems(array $order_items) {
$this->orderItems = $order_items;
return $this;
}
/**
* Gets the order.
*
* @return \Drupal\commerce_order\Entity\OrderInterface
* The order.
*/
public function getOrder() {
return $this->order;
}
/**
* Sets the order.
*
* @param \Drupal\commerce_order\Entity\OrderInterface $order
* The order.
*
* @return $this
*/
public function setOrder(OrderInterface $order) {
$this->order = $order;
return $this;
}
/**
* Gets the shipping profile.
*
* @return \Drupal\profile\Entity\ProfileInterface
* The shipping profile.
*/
public function getShippingProfile() {
return $this->shippingProfile;
}
/**
* Sets the shipping profile.
*
* @param \Drupal\profile\Entity\ProfileInterface $shipping_profile
* The shipping profile.
*
* @return $this
*/
public function setShippingProfile(ProfileInterface $shipping_profile) {
$this->shippingProfile = $shipping_profile;
return $this;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
BeforePackEvent:: |
protected | property | The order being packed. | |
BeforePackEvent:: |
protected | property | The order items being packed. | |
BeforePackEvent:: |
protected | property | The selected shipping profile. | |
BeforePackEvent:: |
public | function | Gets the order. | |
BeforePackEvent:: |
public | function | Gets the order items. | |
BeforePackEvent:: |
public | function | Gets the shipping profile. | |
BeforePackEvent:: |
public | function | Sets the order. | |
BeforePackEvent:: |
public | function | Sets the plugin types. | |
BeforePackEvent:: |
public | function | Sets the shipping profile. | |
BeforePackEvent:: |
public | function | Constructs a new BeforePackEvent object. |