You are here

public function UltimateCronBackgroundProcessLegacyLauncher::getProgressMultiple in Ultimate Cron 7.2

Implementation of getProgressMultiple().

Parameters

UltimateCronJob $jobs: Jobs to get progresses for, keyed by job name.

Return value

array Progresses, keyed by job name.

Overrides UltimateCronLauncher::getProgressMultiple

File

plugins/ultimate_cron/launcher/background_process_legacy.class.php, line 641
Background Process 1.x launcher for Ultimate Cron.

Class

UltimateCronBackgroundProcessLegacyLauncher
Ultimate Cron launcher plugin class.

Code

public function getProgressMultiple($jobs) {
  $names = array();
  foreach ($jobs as $job) {
    $names[] = 'uc-' . $job->name;
  }
  $result = db_select('progress', 'p')
    ->fields('p', array(
    'name',
    'progress',
  ))
    ->condition('name', $names, 'IN')
    ->execute()
    ->fetchAllAssoc('name');
  $progresses = array();
  foreach ($jobs as $job) {
    $progresses[$job->name] = isset($result['uc-' . $job->name]) ? $result['uc-' . $job->name]->progress : FALSE;
  }
  return $progresses;
}