user_views_query_substitutions

user_views_query_substitutions(ViewExecutable $view)

Implements hook_views_query_substitutions().

Allow replacement of current userid so we can cache these queries.

File

core/modules/user/user.views_execution.inc, line 15
Provide views runtime hooks for user.module.

Code

function user_views_query_substitutions(ViewExecutable $view) {
  return array('***CURRENT_USER***' => \Drupal::currentUser()->id());
}
doc_Drupal
2016-10-29 09:53:22
Comments
Leave a Comment

Please login to continue.