You are here

public function TMGMTJob::abortTranslation in Translation Management Tool 7

Attempts to abort the translation job. Already accepted jobs can not be aborted, submitted jobs only if supported by the translator plugin. Always use this method if you want to abort a translation job.

Return value

boolean TRUE if the translation job was aborted, FALSE otherwise.

File

entity/tmgmt.entity.job.inc, line 648

Class

TMGMTJob
Entity class for the tmgmt_job entity.

Code

public function abortTranslation() {
  if (!$this
    ->isAbortable() || !($controller = $this
    ->getTranslatorController())) {
    return FALSE;
  }

  // We don't know if the translator plugin was able to abort the translation
  // job after this point. That means that the plugin has to set the
  // 'aborted' state on its own.
  return $controller
    ->abortTranslation($this);
}