user_load($uid, $reset = FALSE)
Loads a user object.
Parameters
int $uid: Integer specifying the user ID to load.
bool $reset: TRUE to reset the internal cache and load from the database; FALSE (default) to load from the internal cache, if set.
Return value
\Drupal\user\UserInterface A fully-loaded user object upon successful user load, or NULL if the user cannot be loaded.
Deprecated
in Drupal 8.x, will be removed before Drupal 9.0. Use \Drupal\user\Entity\User::load().
See also
\Drupal\user\Entity\User::loadMultiple()
File
- core/modules/user/user.module, line 216
- Enables the user registration and login system.
Code
1 2 3 4 5 6 | function user_load( $uid , $reset = FALSE) { if ( $reset ) { \Drupal::entityManager()->getStorage( 'user' )->resetCache( array ( $uid )); } return User::load( $uid ); } |
Please login to continue.