Loads multiple users based on certain conditions.
This function should be used whenever you need to load more than one user from the database. Users are loaded into memory and will not require database access if loaded again during the same page request.
array $uids: (optional) An array of entity IDs. If omitted, all entities are loaded.
bool $reset: A boolean indicating that the internal cache should be reset. Use this if loading a user object which has been altered during the page request.
array An array of user objects, indexed by uid.
\Drupal\Core\Entity\Query\QueryInterface
function user_load_multiple(array $uids = NULL, $reset = FALSE) {
return entity_load_multiple('user', $uids, $reset);
}