1 form.inc _batch_queue($batch_set)

Returns a queue object for a batch set.

Parameters

$batch_set: The batch set.

Return value

BatchQueue: The queue object.

Related topics

File

core/includes/form.inc, line 5520
Functions for form and batch generation and processing.

Code

function _batch_queue($batch_set) {
  static $queues;

  // The class autoloader is not available when running update.php, so make
  // sure the files are manually included.
  if (!isset($queues)) {
    $queues = array();
    require_once BACKDROP_ROOT . '/core/modules/system/system.queue.inc';
    require_once BACKDROP_ROOT . '/core/includes/batch.queue.inc';
  }

  if (isset($batch_set['queue'])) {
    $name = $batch_set['queue']['name'];
    $class = $batch_set['queue']['class'];

    if (!isset($queues[$class][$name])) {
      $queues[$class][$name] = new $class($name);
    }
    return $queues[$class][$name];
  }
}