public function BatchStorage::load

Loads a batch.

Parameters

int $id: The ID of the batch to load.

Return value

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

Overrides BatchStorageInterface::load

File

drupal/core/lib/Drupal/Core/Utility/BatchStorage.php, line 26
Contains \Drupal\Core\Utility\BatchStorage.

Class

BatchStorage

Namespace

Drupal\Core\Utility

Code

public function load($id) {
  $batch = $this->connection
    ->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;
}