You are here

function tmgmt_update_8007 in Translation Management Tool 8

Updates the state to 'continuous' of all continuous translation jobs.

File

./tmgmt.install, line 97
Update function for the tmgmt module.

Code

function tmgmt_update_8007() {
  $continuous_jobs = \Drupal::entityTypeManager()
    ->getStorage('tmgmt_job')
    ->loadByProperties([
    'job_type' => Job::TYPE_CONTINUOUS,
  ]);

  /** @var \Drupal\tmgmt\JobInterface $continuous_job */
  foreach ($continuous_jobs as $continuous_job) {
    $continuous_job
      ->setState(Job::STATE_CONTINUOUS);
  }
}