You are here

public function Shipment::setWeight in Commerce Shipping 8.2

Sets the shipment weight.

Parameters

\Drupal\physical\Weight $weight: The shipment weight.

Return value

$this

Overrides ShipmentInterface::setWeight

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

File

src/Entity/Shipment.php, line 309

Class

Shipment
Defines the shipment entity class.

Namespace

Drupal\commerce_shipping\Entity

Code

public function setWeight(Weight $weight) {
  $this
    ->set('weight', $weight);
  return $this;
}