protected AccountProxy::loadUserEntity($account_id)
Load a user entity.
The entity manager requires additional initialization code and cache clearing after the list of modules is changed. Therefore it is necessary to retrieve it as late as possible.
Because of serialization issues it is currently not possible to inject the container into the AccountProxy. Thus it is necessary to retrieve the entity manager statically.
int $account_id: The id of an account to load.
\Drupal\Core\Session\AccountInterface|NULL An account or NULL if none is found.
https://www.drupal.org/node/2430447
protected function loadUserEntity($account_id) { return \Drupal::entityManager()->getStorage('user')->load($account_id); }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Session!AccountProxy.php/function/AccountProxy::loadUserEntity/8.1.x