You are here

public function Order::setItems in Commerce Core 8.2

Sets the order items.

Parameters

\Drupal\commerce_order\Entity\OrderItemInterface[] $order_items: The order items.

Return value

$this

Overrides OrderInterface::setItems

File

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

Class

Order
Defines the order entity class.

Namespace

Drupal\commerce_order\Entity

Code

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