You are here

public static function JobScheduler::get in Job Scheduler 7

Same name and namespace in other branches
  1. 7.2 JobScheduler.inc \JobScheduler::get()

Produces a single instance of JobScheduler for a schedule name.

File

./JobScheduler.inc, line 25
JobScheduler class.

Class

JobScheduler
Manage scheduled jobs.

Code

public static function get($name) {
  static $schedulers;

  // Instantiante a new scheduler for $name if we haven't done so yet.
  if (!isset($schedulers[$name])) {
    $class = variable_get('job_scheduler_class_' . $name, 'JobScheduler');
    $schedulers[$name] = new $class($name);
  }
  return $schedulers[$name];
}