1 | <?php |
||
19 | class LatestCheckSubscriber implements EventSubscriberInterface { |
||
20 | |||
21 | /** |
||
22 | * Drupal\Core\Cache\CacheTagsInvalidator definition. |
||
23 | * |
||
24 | * @var \Drupal\Core\Cache\CacheTagsInvalidator |
||
25 | */ |
||
26 | protected $cacheTagsInvalidator; |
||
27 | |||
28 | /** |
||
29 | * Drupal\Core\Theme\ThemeManager definition. |
||
30 | * |
||
31 | * @var \Drupal\Core\Theme\ThemeManager |
||
32 | */ |
||
33 | protected $themeManager; |
||
34 | |||
35 | /** |
||
36 | * Constructor. |
||
37 | */ |
||
38 | public function __construct(CacheTagsInvalidator $cache_tags_invalidator, ThemeManager $theme_manager) { |
||
42 | |||
43 | /** |
||
44 | * {@inheritdoc} |
||
45 | */ |
||
46 | static function getSubscribedEvents() { |
||
50 | |||
51 | /** |
||
52 | * Given 'node' in the request params, |
||
53 | * and the current user can view 'latest' revisions: |
||
54 | * Invalidate the current theme's local actions cache, |
||
55 | * so that hook_menu_local_tasks_alter() is called. |
||
56 | * |
||
57 | * @param \Symfony\Component\HttpKernel\Event\GetResponseEvent $event |
||
58 | */ |
||
59 | public function checkForLatest(GetResponseEvent $event) { |
||
68 | |||
69 | } |
||
70 |
Adding explicit visibility (
private
,protected
, orpublic
) is generally recommend to communicate to other developers how, and from where this method is intended to be used.