function BookNavigationCacheContext::__construct

Same name and namespace in other branches
  1. 8.9.x core/modules/book/src/Cache/BookNavigationCacheContext.php \Drupal\book\Cache\BookNavigationCacheContext::__construct()
  2. 10 core/modules/book/src/Cache/BookNavigationCacheContext.php \Drupal\book\Cache\BookNavigationCacheContext::__construct()
  3. 11.x 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;
}

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