You are here

public function ShippingOrderManager::getProfile in Commerce Shipping 8.2

Gets the shipping profile for the given order.

Parameters

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

Return value

\Drupal\profile\Entity\ProfileInterface|null The shipping profile, or NULL if none found.

Overrides ShippingOrderManagerInterface::getProfile

1 call to ShippingOrderManager::getProfile()
ShippingOrderManager::pack in src/ShippingOrderManager.php
Packs the given order into shipments.

File

src/ShippingOrderManager.php, line 72

Class

ShippingOrderManager

Namespace

Drupal\commerce_shipping

Code

public function getProfile(OrderInterface $order) {
  $profiles = $order
    ->collectProfiles();
  return isset($profiles['shipping']) ? $profiles['shipping'] : NULL;
}