You are here

public function SmartlingTranslatorUi::runCron in TMGMT Translator Smartling 8.3

Same name and namespace in other branches
  1. 8.4 src/SmartlingTranslatorUi.php \Drupal\tmgmt_smartling\SmartlingTranslatorUi::runCron()
  2. 8.2 src/SmartlingTranslatorUi.php \Drupal\tmgmt_smartling\SmartlingTranslatorUi::runCron()

Parameters

array $form:

\Drupal\Core\Form\FormStateInterface $form_state:

File

src/SmartlingTranslatorUi.php, line 390
Contains \Drupal\tmgmt_smartling\SmartlingTranslatorUi.

Class

SmartlingTranslatorUi
Smartling translator UI.

Namespace

Drupal\tmgmt_smartling

Code

public function runCron(array &$form, FormStateInterface $form_state) {
  if (\Drupal::service('cron')
    ->run()) {
    drupal_set_message(t('Cron ran successfully.'));
  }
  else {
    drupal_set_message(t('Cron run failed.'), 'error');
  }
}