function user_load($uid, $reset = FALSE) { if ($reset) { Drupal::entityManager() ->getStorage('user') ->resetCache(array( $uid, )); } return User::load($uid); }
$user = user_load_by_name('username');