function user_load_multiple
Same name in other branches
- 8.9.x core/modules/user/user.module \user_load_multiple()
Load 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.
@todo Remove $conditions in Drupal 8.
Parameters
$uids: An array of user IDs.
$conditions: (deprecated) An associative array of conditions on the {users} table, where the keys are the database fields and the values are the values those fields must have. Instead, it is preferable to use EntityFieldQuery to retrieve a list of entity IDs loadable by this function.
$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.
Return value
An array of user objects, indexed by uid.
See also
17 calls to user_load_multiple()
- profile_browse in modules/
profile/ profile.pages.inc - Menu callback; display a list of user information.
- UserCancelTestCase::testUserCancelInvalid in modules/
user/ user.test - Attempt invalid account cancellations.
- UserRegistrationTestCase::testRegistrationDefaultValues in modules/
user/ user.test - UserRegistrationTestCase::testRegistrationWithEmailVerification in modules/
user/ user.test - UserRegistrationTestCase::testRegistrationWithoutEmailVerification in modules/
user/ user.test
File
-
modules/
user/ user.module, line 290
Code
function user_load_multiple($uids = array(), $conditions = array(), $reset = FALSE) {
return entity_load('user', $uids, $conditions, $reset);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.