Creates a job item and adds it into the cart.
string $plugin: The source plugin.
string $item_type: The source item type.
$item_id: The source item id.
JobItem|null Added job item. If the item exists NULL is returned.
public function addJobItem($plugin, $item_type, $item_id) {
if ($this
->isSourceItemAdded($plugin, $item_type, $item_id)) {
return NULL;
}
$job_item = tmgmt_job_item_create($plugin, $item_type, $item_id);
$job_item
->save();
$this->cart[] = $job_item
->id();
return $job_item;
}