function DatabaseQueue::ensureTableExists
Check if the table exists and create it if not.
1 call to DatabaseQueue::ensureTableExists()
- DatabaseQueue::createItem in core/
lib/ Drupal/ Core/ Queue/ DatabaseQueue.php - Adds a queue item and store it directly to the queue.
File
-
core/
lib/ Drupal/ Core/ Queue/ DatabaseQueue.php, line 267
Class
- DatabaseQueue
- Default queue implementation.
Namespace
Drupal\Core\QueueCode
protected function ensureTableExists() {
try {
$database_schema = $this->connection
->schema();
$schema_definition = $this->schemaDefinition();
$database_schema->createTable(static::TABLE_NAME, $schema_definition);
} catch (DatabaseException) {
} catch (\Exception) {
return FALSE;
}
return TRUE;
}