summaryrefslogtreecommitdiff
path: root/includes/UserArray.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/UserArray.php')
-rw-r--r--includes/UserArray.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/includes/UserArray.php b/includes/UserArray.php
index a2f54b7f..d48a4440 100644
--- a/includes/UserArray.php
+++ b/includes/UserArray.php
@@ -12,6 +12,17 @@ abstract class UserArray implements Iterator {
return $userArray;
}
+ static function newFromIDs( $ids ) {
+ $ids = array_map( 'intval', (array)$ids ); // paranoia
+ if ( !$ids )
+ // Database::select() doesn't like empty arrays
+ return new ArrayIterator(array());
+ $dbr = wfGetDB( DB_SLAVE );
+ $res = $dbr->select( 'user', '*', array( 'user_id' => $ids ),
+ __METHOD__ );
+ return self::newFromResult( $res );
+ }
+
protected static function newFromResult_internal( $res ) {
$userArray = new UserArrayFromResult( $res );
return $userArray;