You are here

public function Subscription::addOrder in Commerce Recurring Framework 8

Adds a recurring order.

Parameters

\Drupal\commerce_order\Entity\OrderInterface $order: The recurring order.

Return value

$this

Overrides SubscriptionInterface::addOrder

File

src/Entity/Subscription.php, line 363

Class

Subscription
Defines the subscription entity.

Namespace

Drupal\commerce_recurring\Entity

Code

public function addOrder(OrderInterface $order) {
  if (!$this
    ->hasOrder($order)) {
    $this
      ->get('orders')
      ->appendItem($order);
  }
  return $this;
}