You are here

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\Event
View 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

Namesort descending Modifiers Type Description Overrides
BeforePackEvent::$order protected property The order being packed.
BeforePackEvent::$orderItems protected property The order items being packed.
BeforePackEvent::$shippingProfile protected property The selected shipping profile.
BeforePackEvent::getOrder public function Gets the order.
BeforePackEvent::getOrderItems public function Gets the order items.
BeforePackEvent::getShippingProfile public function Gets the shipping profile.
BeforePackEvent::setOrder public function Sets the order.
BeforePackEvent::setOrderItems public function Sets the plugin types.
BeforePackEvent::setShippingProfile public function Sets the shipping profile.
BeforePackEvent::__construct public function Constructs a new BeforePackEvent object.