Defines the book navigation cache context service.
Cache context ID: 'route.book_navigation'.
This allows for book navigation location-aware caching. It depends on:
- whether the current route represents a book node at all
- and if so, where in the book hierarchy we are
This class is container-aware to avoid initializing the 'book.manager' service when it is not necessary.
Hierarchy
- class \Drupal\book\Cache\BookNavigationCacheContext implements CacheContextInterface, ContainerAwareInterface uses ContainerAwareTrait
File
- core/modules/book/src/Cache/BookNavigationCacheContext.php, line 23
Namespace
Drupal\book\Cache
Members
Name | Modifiers | Type | Description |
---|---|---|---|
BookNavigationCacheContext::$requestStack | protected | property | The request stack. |
BookNavigationCacheContext::getCacheableMetadata | public | function | Gets the cacheability metadata for the context. Overrides CacheContextInterface::getCacheableMetadata |
BookNavigationCacheContext::getContext | public | function | Returns the string representation of the cache context. Overrides CacheContextInterface::getContext |
BookNavigationCacheContext::getLabel | public static | function | Returns the label of the cache context. Overrides CacheContextInterface::getLabel |
BookNavigationCacheContext::__construct | public | function | Constructs a new BookNavigationCacheContext service. |
ContainerAwareTrait::$container | protected | property | |
ContainerAwareTrait::setContainer | public | function | Sets the container. Overrides ContainerAwareInterface::setContainer |
Please login to continue.