MediaWiki  1.23.0
UserArrayFromResult.php
Go to the documentation of this file.
1 <?php
23 class UserArrayFromResult extends UserArray implements Countable {
24 
28  var $res;
29  var $key, $current;
30 
34  function __construct( $res ) {
35  $this->res = $res;
36  $this->key = 0;
37  $this->setCurrent( $this->res->current() );
38  }
39 
44  protected function setCurrent( $row ) {
45  if ( $row === false ) {
46  $this->current = false;
47  } else {
48  $this->current = User::newFromRow( $row );
49  }
50  }
51 
55  public function count() {
56  return $this->res->numRows();
57  }
58 
62  function current() {
63  return $this->current;
64  }
65 
66  function key() {
67  return $this->key;
68  }
69 
70  function next() {
71  $row = $this->res->next();
72  $this->setCurrent( $row );
73  $this->key++;
74  }
75 
76  function rewind() {
77  $this->res->rewind();
78  $this->key = 0;
79  $this->setCurrent( $this->res->current() );
80  }
81 
85  function valid() {
86  return $this->current !== false;
87  }
88 }
UserArrayFromResult\$key
$key
Definition: UserArrayFromResult.php:28
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
UserArrayFromResult\count
count()
Definition: UserArrayFromResult.php:54
UserArrayFromResult\key
key()
Definition: UserArrayFromResult.php:65
User\newFromRow
static newFromRow( $row, $data=null)
Create a new user object from a user row.
Definition: User.php:470
UserArrayFromResult\$current
$current
Definition: UserArrayFromResult.php:28
UserArrayFromResult\__construct
__construct( $res)
Definition: UserArrayFromResult.php:33
UserArrayFromResult\setCurrent
setCurrent( $row)
Definition: UserArrayFromResult.php:43
UserArrayFromResult\current
current()
Definition: UserArrayFromResult.php:61
UserArrayFromResult
Definition: UserArrayFromResult.php:23
UserArray
Definition: UserArray.php:23
UserArrayFromResult\rewind
rewind()
Definition: UserArrayFromResult.php:75
UserArrayFromResult\valid
valid()
Definition: UserArrayFromResult.php:84
UserArrayFromResult\$res
ResultWrapper $res
Definition: UserArrayFromResult.php:27
UserArrayFromResult\next
next()
Definition: UserArrayFromResult.php:69
ResultWrapper
Result wrapper for grabbing data queried by someone else.
Definition: DatabaseUtility.php:99