You are here

function job_scheduler_info in Job Scheduler 8.2

Same name and namespace in other branches
  1. 8.3 job_scheduler.module \job_scheduler_info()
  2. 7.2 job_scheduler.module \job_scheduler_info()

Collects and returns scheduler info.

Parameters

string $name: (optional) Name of the schedule. Defaults to null.

Return value

array Information for the schedule if $name, all the information if not.

See also

hook_cron_job_scheduler_info()

2 calls to job_scheduler_info()
JobScheduler::info in src/JobScheduler.php
Returns scheduler info.
JobScheduler::rebuildAll in src/JobScheduler.php
Rebuilds all schedulers.

File

./job_scheduler.module, line 19
Job scheduler module.

Code

function job_scheduler_info($name = NULL) {
  $info =& drupal_static(__FUNCTION__);
  if (!$info) {
    $module_handler = \Drupal::moduleHandler();
    $info = $module_handler
      ->invokeAll('cron_job_scheduler_info');
    $module_handler
      ->alter('cron_job_scheduler_info', $info);
  }
  if ($name) {
    return isset($info[$name]) ? $info[$name] : NULL;
  }
  else {
    return $info;
  }
}