public function MongoBatchBackend::load in MongoDB 8
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
- src/
MongoBatchBackend.php, line 54 - Contains \Drupal\mongodb\MongoBatchBackend.
Class
Namespace
Drupal\mongodbCode
public function load($id) {
// Ensure that a session is started before using the CSRF token generator.
$this->sessionManager
->start();
$batch = $this
->mongoCollection()
->findOne([
'_id' => (int) $id,
'token' => $this->csrfToken
->get($id),
]);
return $batch ? unserialize($batch['batch']) : $batch;
}