You are here

public function BookNavigationCacheContext::__construct in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/book/src/Cache/BookNavigationCacheContext.php \Drupal\book\Cache\BookNavigationCacheContext::__construct()

Constructs a new BookNavigationCacheContext service.

Parameters

\Drupal\Core\Routing\RouteMatchInterface $route_match: The current route match.

File

core/modules/book/src/Cache/BookNavigationCacheContext.php, line 48

Class

BookNavigationCacheContext
Defines the book navigation cache context service.

Namespace

Drupal\book\Cache

Code

public function __construct($route_match) {
  if (!$route_match instanceof RouteMatchInterface) {
    @trigger_error('Passing the request_stack service to ' . __METHOD__ . '() is deprecated in drupal:9.2.0 and will be removed before drupal:10.0.0. The parameter should be an instance of \\Drupal\\Core\\Routing\\RouteMatchInterface instead.', E_USER_DEPRECATED);
    $route_match = \Drupal::routeMatch();
  }
  $this->routeMatch = $route_match;
}