function Current::getCacheContexts

Overrides FilterPluginBase::getCacheContexts

File

core/modules/user/src/Plugin/views/filter/Current.php, line 49

Class

Current
Filter handler for the current user.

Namespace

Drupal\user\Plugin\views\filter

Code

public function getCacheContexts() {
  $contexts = parent::getCacheContexts();
  // This filter depends on the current user.
  $contexts[] = 'user';
  return $contexts;
}

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