public function JobItemCart::addExistingJobItems

Adds existing job items into the cart.

Parameters

\Drupal\tmgmt\JobItemInterface[] $items: Job items to be added.

File

src/JobItemCart.php, line 47

Class

JobItemCart
Represents a job item cart.

Namespace

Drupal\tmgmt

Code

public function addExistingJobItems(array $items) {
  foreach ($items as $item) {
    if (!$this
      ->isSourceItemAdded($item
      ->getPlugin(), $item
      ->getItemType(), $item
      ->getItemId())) {
      $this->cart[] = $item
        ->id();
    }
  }
}