Upgraded drupal core with security updates
[yaffs-website] / web / core / modules / views / tests / modules / views_test_data / src / Plugin / views / filter / ViewsTestCacheContextFilter.php
1 <?php
2
3 namespace Drupal\views_test_data\Plugin\views\filter;
4
5 use Drupal\views\Plugin\views\filter\FilterPluginBase;
6
7 /**
8  * @ViewsFilter("views_test_test_cache_context")
9  */
10 class ViewsTestCacheContextFilter extends FilterPluginBase {
11
12   /**
13    * {@inheritdoc}
14    */
15   public function query() {
16     $this->value = \Drupal::state()->get('views_test_cache_context', 'George');
17
18     parent::query();
19   }
20
21   /**
22    * {@inheritdoc}
23    */
24   public function getCacheContexts() {
25     $cache_contexts = parent::getCacheContexts();
26
27     $cache_contexts[] = 'views_test_cache_context';
28     return $cache_contexts;
29   }
30
31 }