8.5.x form.inc _batch_queue($batch_set)
8.0.x form.inc _batch_queue($batch_set)
8.1.x form.inc _batch_queue($batch_set)
8.2.x form.inc _batch_queue($batch_set)
8.3.x form.inc _batch_queue($batch_set)
8.4.x form.inc _batch_queue($batch_set)
8.6.x form.inc _batch_queue($batch_set)
7.x form.inc _batch_queue($batch_set)

Returns a queue object for a batch set.

Parameters

$batch_set: The batch set.

Return value

The queue object.

Related topics

3 calls to _batch_queue()
_batch_finished in includes/batch.inc
Ends the batch processing.
_batch_populate_queue in includes/form.inc
Populates a job queue with the operations of a batch set.
_batch_process in includes/batch.inc
Processes sets in a batch.

File

includes/form.inc, line 4779
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 DRUPAL_ROOT . '/modules/system/system.queue.inc';
    require_once DRUPAL_ROOT . '/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];
  }
}