You are here

public function Shipment::getShippingMethod in Commerce Shipping 8.2

Gets the shipping method.

Return value

\Drupal\commerce_shipping\Entity\ShippingMethodInterface|null The shipping method, or NULL if unknown.

Overrides ShipmentInterface::getShippingMethod

1 call to Shipment::getShippingMethod()
Shipment::prepareFields in src/Entity/Shipment.php
Ensures that the package_type and weight fields are populated.

File

src/Entity/Shipment.php, line 161

Class

Shipment
Defines the shipment entity class.

Namespace

Drupal\commerce_shipping\Entity

Code

public function getShippingMethod() {
  return $this
    ->get('shipping_method')->entity;
}