MediaWiki  1.23.2
UserArray.php
Go to the documentation of this file.
1 <?php
23 abstract class UserArray implements Iterator {
28  static function newFromResult( $res ) {
29  $userArray = null;
30  if ( !wfRunHooks( 'UserArrayFromResult', array( &$userArray, $res ) ) ) {
31  return null;
32  }
33  if ( $userArray === null ) {
34  $userArray = self::newFromResult_internal( $res );
35  }
36  return $userArray;
37  }
38 
43  static function newFromIDs( $ids ) {
44  $ids = array_map( 'intval', (array)$ids ); // paranoia
45  if ( !$ids ) {
46  // Database::select() doesn't like empty arrays
47  return new ArrayIterator( array() );
48  }
49  $dbr = wfGetDB( DB_SLAVE );
50  $res = $dbr->select(
51  'user',
53  array( 'user_id' => array_unique( $ids ) ),
54  __METHOD__
55  );
56  return self::newFromResult( $res );
57  }
58 
63  protected static function newFromResult_internal( $res ) {
64  return new UserArrayFromResult( $res );
65  }
66 }
php
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
Definition: skin.txt:62
wfGetDB
& wfGetDB( $db, $groups=array(), $wiki=false)
Get a Database object.
Definition: GlobalFunctions.php:3650
UserArrayFromResult
return false to override stock group addition can be modified UserArrayFromResult
Definition: hooks.txt:2697
$dbr
$dbr
Definition: testCompression.php:48
UserArray\newFromResult_internal
static newFromResult_internal( $res)
Definition: UserArray.php:63
UserArray\newFromResult
static newFromResult( $res)
Definition: UserArray.php:28
wfRunHooks
wfRunHooks( $event, array $args=array(), $deprecatedVersion=null)
Call hook functions defined in $wgHooks.
Definition: GlobalFunctions.php:4001
array
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
UserArray
Definition: UserArray.php:23
UserArray\newFromIDs
static newFromIDs( $ids)
Definition: UserArray.php:43
DB_SLAVE
const DB_SLAVE
Definition: Defines.php:55
User\selectFields
static selectFields()
Return the list of user fields that should be selected to create a new user object.
Definition: User.php:4827
$res
$res
Definition: database.txt:21