function tmgmt_local_tmgmt_job_delete

Implements hook_tmgmt_job_delete().

File

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

Code

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