Returns the translator for this job.
\Drupal\tmgmt\Entity\Translator The translator entity.
\Drupal\tmgmt\TMGMTException Throws an exception when there is no translator assigned or when the translator is missing the plugin.
Overrides JobInterface::getTranslator
public function getTranslator() {
if ($this
->hasTranslator()) {
return $this->translator->entity;
}
else {
if (!$this->translator->entity) {
throw new TMGMTException('The job has no provider assigned.');
}
else {
if (!$this->translator->entity
->hasPlugin()) {
throw new TMGMTException('The translator assigned to this job is missing the plugin.');
}
}
}
}