user.views_execution.inc 372 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
<?php

/**
 * @file
 * Provide views runtime hooks for user.module.
 */

use Drupal\views\ViewExecutable;

/**
 * Implements hook_views_query_substitutions().
 *
 * Allow replacement of current userid so we can cache these queries.
 */
function user_views_query_substitutions(ViewExecutable $view) {
16
  return array('***CURRENT_USER***' => \Drupal::currentUser()->id());
17
}