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

Breadcrumb

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

function UserViewsExecutionHooks::viewsQuerySubstitutions

Implements hook_views_query_substitutions().

Allow replacement of current user ID so we can cache these queries.

File

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

Class

UserViewsExecutionHooks
Hook implementations for user.

Namespace

Drupal\user\Hook

Code

public function viewsQuerySubstitutions(ViewExecutable $view) {
    return [
        '***CURRENT_USER***' => \Drupal::currentUser()->id(),
    ];
}

API Navigation

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