function MatcherDumper::ensureTableExists
Same name in other branches
- 8.9.x core/lib/Drupal/Core/Routing/MatcherDumper.php \Drupal\Core\Routing\MatcherDumper::ensureTableExists()
- 10 core/lib/Drupal/Core/Routing/MatcherDumper.php \Drupal\Core\Routing\MatcherDumper::ensureTableExists()
- 11.x core/lib/Drupal/Core/Routing/MatcherDumper.php \Drupal\Core\Routing\MatcherDumper::ensureTableExists()
Checks if the tree table exists and create it if not.
Return value
bool TRUE if the table was created, FALSE otherwise.
1 call to MatcherDumper::ensureTableExists()
- MatcherDumper::dump in core/
lib/ Drupal/ Core/ Routing/ MatcherDumper.php - Dumps a set of routes to the router table in the database.
File
-
core/
lib/ Drupal/ Core/ Routing/ MatcherDumper.php, line 183
Class
- MatcherDumper
- Dumps Route information to a database table.
Namespace
Drupal\Core\RoutingCode
protected function ensureTableExists() {
try {
$this->connection
->schema()
->createTable($this->tableName, $this->schemaDefinition());
} catch (DatabaseException $e) {
// If another process has already created the config table, attempting to
// recreate it will throw an exception. In this case just catch the
// exception and do nothing.
} catch (\Exception $e) {
return FALSE;
}
return TRUE;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.