public function JobItemCart::isSourceItemAdded

Checks if the source item has been added into the cart.

Parameters

string $plugin: The source plugin.

string $item_type: The source type.

int $source_id: The source id.

Return value

bool If the source item is in the cart.

File

src/JobItemCart.php, line 92

Class

JobItemCart
Represents a job item cart.

Namespace

Drupal\tmgmt

Code

public function isSourceItemAdded($plugin, $item_type, $source_id) {
  foreach ($this
    ->getJobItemsFromCart() as $job_item) {
    if ($job_item
      ->getItemId() == $source_id && $job_item
      ->getItemType() == $item_type && $job_item
      ->getPlugin() == $plugin) {
      return TRUE;
    }
  }
  return FALSE;
}