public function TMGMTLocalTask::addTaskItem in Translation Management Tool 7
Create a task item for this task and the given job item.
Parameters
TMGMTJobItem $job_item: The job item.
File
- translators/
tmgmt_local/ entity/ tmgmt_local.entity.task.inc, line 187
Class
- TMGMTLocalTask
- Entity class for the local task entity.
Code
public function addTaskItem(TMGMTJobItem $job_item) {
// Save the task to get an id.
if (empty($this->tltid)) {
$this
->save();
}
$local_task = entity_create('tmgmt_local_task_item', array(
'tltid' => $this
->identifier(),
'tjiid' => $job_item
->identifier(),
));
$local_task
->save();
return $local_task;
}