3 namespace Drupal\user\Plugin\views\argument_default;
5 use Drupal\Core\Cache\Cache;
6 use Drupal\Core\Cache\CacheableDependencyInterface;
7 use Drupal\views\Plugin\views\argument_default\ArgumentDefaultPluginBase;
10 * Default argument plugin to extract the current user
12 * This plugin actually has no options so it does not need to do a great deal.
14 * @ViewsArgumentDefault(
15 * id = "current_user",
16 * title = @Translation("User ID from logged in user")
19 class CurrentUser extends ArgumentDefaultPluginBase implements CacheableDependencyInterface {
24 public function getArgument() {
25 return \Drupal::currentUser()->id();
31 public function getCacheMaxAge() {
32 return Cache::PERMANENT;
38 public function getCacheContexts() {