function BatchStorage::doInsertBatchRecord

Same name in other branches
  1. 11.x core/lib/Drupal/Core/Batch/BatchStorage.php \Drupal\Core\Batch\BatchStorage::doInsertBatchRecord()

Inserts a record in the table and returns the batch id.

Return value

int A batch id.

1 call to BatchStorage::doInsertBatchRecord()
BatchStorage::getId in core/lib/Drupal/Core/Batch/BatchStorage.php
Returns a new batch id.

File

core/lib/Drupal/Core/Batch/BatchStorage.php, line 181

Class

BatchStorage

Namespace

Drupal\Core\Batch

Code

protected function doInsertBatchRecord() : int {
    return $this->connection
        ->insert('batch')
        ->fields([
        'timestamp' => $this->time
            ->getRequestTime(),
        'token' => '',
        'batch' => NULL,
    ])
        ->execute();
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.