user.views_execution.inc 368 B

1234567891011121314151617
  1. <?php
  2. /**
  3. * @file
  4. * Provide views runtime hooks for user.module.
  5. */
  6. use Drupal\views\ViewExecutable;
  7. /**
  8. * Implements hook_views_query_substitutions().
  9. *
  10. * Allow replacement of current user ID so we can cache these queries.
  11. */
  12. function user_views_query_substitutions(ViewExecutable $view) {
  13. return ['***CURRENT_USER***' => \Drupal::currentUser()->id()];
  14. }