function AliasRepository::__construct

Same name in other branches
  1. 9 core/modules/path_alias/src/AliasRepository.php \Drupal\path_alias\AliasRepository::__construct()
  2. 10 core/modules/path_alias/src/AliasRepository.php \Drupal\path_alias\AliasRepository::__construct()
  3. 11.x core/modules/path_alias/src/AliasRepository.php \Drupal\path_alias\AliasRepository::__construct()

Constructs an AliasRepository object.

Parameters

\Drupal\Core\Database\Connection $connection: A database connection for reading and writing path aliases.

File

core/lib/Drupal/Core/Path/AliasRepository.php, line 33

Class

AliasRepository
Provides the default path alias lookup operations.

Namespace

Drupal\Core\Path

Code

public function __construct(Connection $connection) {
    $this->connection = $connection;
    // This is used as base class by the new class, so we do not trigger
    // deprecation notices when that or any child class is instantiated.
    $new_class = 'Drupal\\path_alias\\AliasRepository';
    if (!is_a($this, $new_class) && class_exists($new_class)) {
        @trigger_error('The \\' . __CLASS__ . ' class is deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Instead, use \\' . $new_class . '. See https://drupal.org/node/3092086', E_USER_DEPRECATED);
    }
}

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