protected BatchStorage::ensureTableExists()
Check if the table exists and create it if not.
File
- core/lib/Drupal/Core/Batch/BatchStorage.php, line 165
Class
Namespace
Drupal\Core\Batch
Code
protected function ensureTableExists() {
try {
$database_schema = $this->connection->schema();
if (!$database_schema->tableExists(static::TABLE_NAME)) {
$schema_definition = $this->schemaDefinition();
$database_schema->createTable(static::TABLE_NAME, $schema_definition);
return TRUE;
}
}
// If another process has already created the batch table, attempting to
// recreate it will throw an exception. In this case just catch the
// exception and do nothing.
catch (SchemaObjectExistsException $e) {
return TRUE;
}
return FALSE;
}
Please login to continue.