You are here

protected function CommerceFedExPacker::getOrderItems in Commerce FedEx 8

Gets the order items and fires an event to allow overriding before packing.

Parameters

\Drupal\commerce_order\Entity\OrderInterface $order: The order.

\Drupal\profile\Entity\ProfileInterface $shipping_profile: The shipping profile.

Return value

\Drupal\commerce_order\Entity\OrderItemInterface[] The order items.

1 call to CommerceFedExPacker::getOrderItems()
CommerceFedExPacker::pack in src/Packer/CommerceFedExPacker.php
Packs the given order.

File

src/Packer/CommerceFedExPacker.php, line 136

Class

CommerceFedExPacker
Defines a shipment packer for FedEx.

Namespace

Drupal\commerce_fedex\Packer

Code

protected function getOrderItems(OrderInterface $order, ProfileInterface $shipping_profile) {
  $event = new BeforePackEvent($order
    ->getItems(), $order, $shipping_profile);
  $this->eventDispatcher
    ->dispatch(CommerceFedExEvents::BEFORE_PACK, $event);
  return $event
    ->getOrderItems();
}