Ejemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 public function requestTranslation(JobInterface $job)
 {
     $tuid = $job->getSetting('translator');
     // Create local task for this job.
     $local_task = tmgmt_local_task_create(array('uid' => $job->getOwnerId(), 'tuid' => $tuid, 'tjid' => $job->id(), 'title' => $job->label()));
     // If we have translator then switch to pending state.
     if ($tuid) {
         $local_task->status = LocalTaskInterface::STATUS_PENDING;
     }
     $local_task->save();
     // Create task items.
     foreach ($job->getItems() as $item) {
         $local_task->addTaskItem($item);
     }
     // The translation job has been successfully submitted.
     $job->submitted();
 }