You are here

public function Order::setAdjustments in Commerce Core 8.2

Sets the adjustments.

Parameters

\Drupal\commerce_order\Adjustment[] $adjustments: The adjustments.

Return value

$this

Overrides EntityAdjustableInterface::setAdjustments

1 call to Order::setAdjustments()
Order::clearAdjustments in modules/order/src/Entity/Order.php
Removes all adjustments that belong to the order.

File

modules/order/src/Entity/Order.php, line 349

Class

Order
Defines the order entity class.

Namespace

Drupal\commerce_order\Entity

Code

public function setAdjustments(array $adjustments) {
  $this
    ->set('adjustments', $adjustments);
  $this
    ->recalculateTotalPrice();
  return $this;
}