MediaWiki  1.23.2
TitleArrayFromResult.php
Go to the documentation of this file.
1 <?php
27 class TitleArrayFromResult extends TitleArray implements Countable {
28 
32  var $res;
33  var $key, $current;
34 
35  function __construct( $res ) {
36  $this->res = $res;
37  $this->key = 0;
38  $this->setCurrent( $this->res->current() );
39  }
40 
45  protected function setCurrent( $row ) {
46  if ( $row === false ) {
47  $this->current = false;
48  } else {
49  $this->current = Title::newFromRow( $row );
50  }
51  }
52 
56  public function count() {
57  return $this->res->numRows();
58  }
59 
60  function current() {
61  return $this->current;
62  }
63 
64  function key() {
65  return $this->key;
66  }
67 
68  function next() {
69  $row = $this->res->next();
70  $this->setCurrent( $row );
71  $this->key++;
72  }
73 
74  function rewind() {
75  $this->res->rewind();
76  $this->key = 0;
77  $this->setCurrent( $this->res->current() );
78  }
79 
83  function valid() {
84  return $this->current !== false;
85  }
86 }
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
TitleArrayFromResult\current
current()
Definition: TitleArrayFromResult.php:59
TitleArrayFromResult\setCurrent
setCurrent( $row)
Definition: TitleArrayFromResult.php:44
TitleArrayFromResult\$current
$current
Definition: TitleArrayFromResult.php:32
Title\newFromRow
static newFromRow( $row)
Make a Title object from a DB row.
Definition: Title.php:345
TitleArrayFromResult
Definition: TitleArrayFromResult.php:27
TitleArrayFromResult\next
next()
Definition: TitleArrayFromResult.php:67
TitleArrayFromResult\$res
ResultWrapper $res
Definition: TitleArrayFromResult.php:31
TitleArrayFromResult\count
count()
Definition: TitleArrayFromResult.php:55
TitleArrayFromResult\key
key()
Definition: TitleArrayFromResult.php:63
TitleArrayFromResult\__construct
__construct( $res)
Definition: TitleArrayFromResult.php:34
TitleArrayFromResult\rewind
rewind()
Definition: TitleArrayFromResult.php:73
TitleArrayFromResult\$key
$key
Definition: TitleArrayFromResult.php:32
TitleArray
The TitleArray class only exists to provide the newFromResult method at pre- sent.
Definition: TitleArray.php:31
TitleArrayFromResult\valid
valid()
Definition: TitleArrayFromResult.php:82
ResultWrapper
Result wrapper for grabbing data queried by someone else.
Definition: DatabaseUtility.php:99