public function ContinuousManager::checkIfContinuousTranslatorAvailable

Returns TRUE if there are translators that support continuous jobs.

File

src/ContinuousManager.php, line 171

Class

ContinuousManager
A service manager for continuous jobs.

Namespace

Drupal\tmgmt

Code

public function checkIfContinuousTranslatorAvailable() {
  $translator_plugins = $this->translatorManager
    ->getDefinitions();
  foreach ($translator_plugins as $type => $definition) {
    $translator_type = $this->translatorManager
      ->createInstance($type);
    if ($translator_type instanceof ContinuousTranslatorInterface) {
      return TRUE;
    }
  }
  return FALSE;
}