You are here

public function Shipment::hasItems in Commerce Shipping 8.2

Gets whether the shipment has items.

Return value

bool TRUE if the shipment has items, FALSE otherwise.

Overrides ShipmentInterface::hasItems

1 call to Shipment::hasItems()
Shipment::recalculateWeight in src/Entity/Shipment.php
Recalculates the shipment's weight.

File

src/Entity/Shipment.php, line 263

Class

Shipment
Defines the shipment entity class.

Namespace

Drupal\commerce_shipping\Entity

Code

public function hasItems() {
  return !$this
    ->get('items')
    ->isEmpty();
}