You are here

public function CurrentAuthenticatedUser::getCurrentUser in Search API Saved Searches 8

Retrieves the current user.

Return value

\Drupal\Core\Session\AccountInterface The current user.

File

src/Plugin/views/argument_validator/CurrentAuthenticatedUser.php, line 61

Class

CurrentAuthenticatedUser
Validates whether the argument matches the current authenticated user.

Namespace

Drupal\search_api_saved_searches\Plugin\views\argument_validator

Code

public function getCurrentUser() {
  return $this->currentUser ?: \Drupal::service('current_user');
}