You are here

public function RouteProvider::getRoutesCount in Drupal 9

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Routing/RouteProvider.php \Drupal\Core\Routing\RouteProvider::getRoutesCount()

Gets the total count of routes provided by the router.

Return value

int Number of routes.

Deprecated

in drupal:9.1.0 and is removed from drupal:10.0.0. No direct replacement is provided.

See also

https://www.drupal.org/node/3151009

File

core/lib/Drupal/Core/Routing/RouteProvider.php, line 480

Class

RouteProvider
A Route Provider front-end for all Drupal-stored routes.

Namespace

Drupal\Core\Routing

Code

public function getRoutesCount() {
  @trigger_error(__METHOD__ . '() is deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. No direct replacement is provided. See https://www.drupal.org/node/3151009', E_USER_DEPRECATED);
  return $this->connection
    ->query("SELECT COUNT(*) FROM {" . $this->connection
    ->escapeTable($this->tableName) . "}")
    ->fetchField();
}