EntityAccessControlHandler::prepareUser

protected EntityAccessControlHandler::prepareUser(AccountInterface $account = NULL)

Loads the current account object, if it does not exist yet.

Parameters

\Drupal\Core\Session\AccountInterface $account: The account interface instance.

Return value

\Drupal\Core\Session\AccountInterface Returns the current account object.

File

core/lib/Drupal/Core/Entity/EntityAccessControlHandler.php, line 290

Class

EntityAccessControlHandler
Defines a default implementation for entity access control handler.

Namespace

Drupal\Core\Entity

Code

protected function prepareUser(AccountInterface $account = NULL) {
  if (!$account) {
    $account = \Drupal::currentUser();
  }
  return $account;
}
doc_Drupal
2016-10-29 09:04:30
Comments
Leave a Comment

Please login to continue.