You are here

public function SearchApiQuery::getAccessAccount in Search API 8

Retrieves the account object to use for access checks for this query.

Return value

\Drupal\Core\Session\AccountInterface|null The account for which to check access to returned or displayed entities. Or NULL to use the currently logged-in user.

1 call to SearchApiQuery::getAccessAccount()
SearchApiQuery::addResults in src/Plugin/views/query/SearchApiQuery.php
Adds Search API result items to a view's result set.

File

src/Plugin/views/query/SearchApiQuery.php, line 789

Class

SearchApiQuery
Defines a Views query class for searching on Search API indexes.

Namespace

Drupal\search_api\Plugin\views\query

Code

public function getAccessAccount() {
  $account = $this
    ->getOption('search_api_access_account');
  if ($account && is_scalar($account)) {
    $account = User::load($account);
  }
  return $account;
}