public function MongoBatchBackend::update in MongoDB 8
Updates a batch.
Parameters
array $batch: The array representing the batch to update.
Overrides BatchStorageInterface::update
File
- src/
MongoBatchBackend.php, line 84 - Contains \Drupal\mongodb\MongoBatchBackend.
Class
Namespace
Drupal\mongodbCode
public function update(array $batch) {
$new['$set']['batch'] = serialize($batch);
$this
->mongoCollection()
->update([
'_id' => (int) $batch['id'],
], $new);
}