You are here

function tmgmt_local_tmgmt_job_delete in Translation Management Tool 8

Same name and namespace in other branches
  1. 7 translators/tmgmt_local/tmgmt_local.module \tmgmt_local_tmgmt_job_delete()

Implements hook_tmgmt_job_delete().

File

translators/tmgmt_local/tmgmt_local.module, line 438
Main module file for the local translation module.

Code

function tmgmt_local_tmgmt_job_delete(JobInterface $job) {
  $tltids = \Drupal::entityQuery('tmgmt_local_task')
    ->condition('tjid', $job
    ->id())
    ->execute();
  if (!empty($tltids)) {
    \Drupal::entityTypeManager()
      ->getStorage('tmgmt_local_task')
      ->delete(LocalTask::loadMultiple($tltids));
  }
}