Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. UserViewsExecutionHooks.php

class UserViewsExecutionHooks

Hook implementations for user.

Hierarchy

  • class \Drupal\user\Hook\UserViewsExecutionHooks

Expanded class hierarchy of UserViewsExecutionHooks

File

core/modules/user/src/Hook/UserViewsExecutionHooks.php, line 11

Namespace

Drupal\user\Hook
View source
class UserViewsExecutionHooks {
    
    /**
     * Implements hook_views_query_substitutions().
     *
     * Allow replacement of current user ID so we can cache these queries.
     */
    public function viewsQuerySubstitutions(ViewExecutable $view) {
        return [
            '***CURRENT_USER***' => \Drupal::currentUser()->id(),
        ];
    }

}

Members

Title Sort descending Modifiers Object type Summary
UserViewsExecutionHooks::viewsQuerySubstitutions public function Implements hook_views_query_substitutions().

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal