You are here

public function Shipment::addAdjustment in Commerce Shipping 8.2

Adds an adjustment.

Parameters

\Drupal\commerce_order\Adjustment $adjustment: The adjustment.

Return value

$this

Overrides EntityAdjustableInterface::addAdjustment

File

src/Entity/Shipment.php, line 397

Class

Shipment
Defines the shipment entity class.

Namespace

Drupal\commerce_shipping\Entity

Code

public function addAdjustment(Adjustment $adjustment) {
  $this
    ->get('adjustments')
    ->appendItem($adjustment);
  return $this;
}