You are here

function flag_views_query_substitutions in Flag 8.4

Same name and namespace in other branches
  1. 6.2 includes/flag.views.inc \flag_views_query_substitutions()
  2. 7.3 includes/views/flag.views.inc \flag_views_query_substitutions()
  3. 7.2 includes/flag.views.inc \flag_views_query_substitutions()

Implements hook_views_query_substitutions().

File

./flag.views_execution.inc, line 13
Contains views API hooks in the views_execution group for Flag module.

Code

function flag_views_query_substitutions(ViewExecutable $view) {

  // Allow replacement of current user's session id so we can cache these
  // queries.
  $session_manager = \Drupal::service('session_manager');
  return [
    '***FLAG_CURRENT_USER_SID***' => $session_manager
      ->getId(),
  ];
}