class UserViewsExecutionHooks

Hook implementations for user.

Hierarchy

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(),
        ];
    }

}

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