function batch_load

batch_load($id)

Loads a batch from the database.

Parameters

$id: The ID of the batch to load. When a progressive batch is being processed, the relevant ID is found in $_REQUEST['id'].

Return value

An array representing the batch, or FALSE if no batch was found.

File

includes/batch.inc, line 27
Batch processing API for processes to run in multiple HTTP requests.

Code

function batch_load($id) {
  $batch = db_query("SELECT batch FROM {batch} WHERE bid = :bid AND token = :token", array(
    ':bid' => $id,
    ':token' => drupal_get_token($id),
  ))->fetchField();
  if ($batch) {
    return unserialize($batch);
  }
  return FALSE;
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/includes!batch.inc/function/batch_load/7.x