function _batch_queue in Drupal 9
Same name and namespace in other branches
- 8 core/includes/form.inc \_batch_queue()
- 7 includes/form.inc \_batch_queue()
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 core/
includes/ batch.inc - Ends the batch processing.
- _batch_populate_queue in core/
includes/ form.inc - Populates a job queue with the operations of a batch set.
- _batch_process in core/
includes/ batch.inc - Processes sets in a batch.
File
- core/
includes/ form.inc, line 1016 - Functions for form and batch generation and processing.
Code
function _batch_queue($batch_set) {
static $queues;
if (!isset($queues)) {
$queues = [];
}
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, \Drupal::database());
}
return $queues[$class][$name];
}
}