Attempts to abort the translation job item.
Already accepted job items can not be aborted. Always use this method if you want to abort a translation job item.
\Drupal\tmgmt\TMGMTException If fails to abort the job item.
Overrides JobItemInterface::abortTranslation
public function abortTranslation() {
if (!$this
->isAbortable() || !$this
->getTranslatorPlugin()) {
throw new TMGMTException('Cannot abort job item.');
}
$this
->setState(JobItemInterface::STATE_ABORTED);
// Check if this was the last unfinished job item in this job.
$job = $this
->getJob();
if ($job && !$job
->isContinuous() && tmgmt_job_check_finished($this
->getJobId())) {
// Mark the job as finished in case it is a normal job.
$job
->finished();
}
}