You are here

public function ShippingOrderManager::hasShipments in Commerce Shipping 8.2

Checks if the given order has shipments.

Parameters

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

Return value

bool TRUE if the order has shipments, FALSE otherwise.

Overrides ShippingOrderManagerInterface::hasShipments

File

src/ShippingOrderManager.php, line 80

Class

ShippingOrderManager

Namespace

Drupal\commerce_shipping

Code

public function hasShipments(OrderInterface $order) {
  return $order
    ->hasField('shipments') && !$order
    ->get('shipments')
    ->isEmpty();
}