class PageCacheRequestPrepareSubscriber in Tome 8
Prepares for a new request when using page cache.
@internal
Hierarchy
- class \Drupal\tome_static\EventSubscriber\PageCacheRequestPrepareSubscriber implements \Symfony\Component\EventDispatcher\EventSubscriberInterface
Expanded class hierarchy of PageCacheRequestPrepareSubscriber
1 file declares its use of PageCacheRequestPrepareSubscriber
- TomeStaticServiceProvider.php in modules/
tome_static/ src/ TomeStaticServiceProvider.php
File
- modules/
tome_static/ src/ EventSubscriber/ PageCacheRequestPrepareSubscriber.php, line 14
Namespace
Drupal\tome_static\EventSubscriberView source
class PageCacheRequestPrepareSubscriber implements EventSubscriberInterface {
/**
* The resettable page cache.
*
* @var \Drupal\tome_static\StackMiddleware\ResettablePageCache
*/
protected $pageCache;
/**
* Constructs the EntityPathSubscriber object.
*
* @param \Drupal\tome_static\StackMiddleware\ResettablePageCache $page_cache
* The resettable page cache.
*/
public function __construct(ResettablePageCache $page_cache) {
$this->pageCache = $page_cache;
}
/**
* Reacts to a collect paths event.
*/
public function prepareForRequest() {
$this->pageCache
->resetCache();
}
/**
* {@inheritdoc}
*/
public static function getSubscribedEvents() {
$events[TomeStaticEvents::REQUEST_PREPARE][] = [
'prepareForRequest',
];
return $events;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
PageCacheRequestPrepareSubscriber:: |
protected | property | The resettable page cache. | |
PageCacheRequestPrepareSubscriber:: |
public static | function | ||
PageCacheRequestPrepareSubscriber:: |
public | function | Reacts to a collect paths event. | |
PageCacheRequestPrepareSubscriber:: |
public | function | Constructs the EntityPathSubscriber object. |