summaryrefslogtreecommitdiff
path: root/includes/TitleArray.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2011-12-03 13:29:22 +0100
committerPierre Schmitz <pierre@archlinux.de>2011-12-03 13:29:22 +0100
commitca32f08966f1b51fcb19460f0996bb0c4048e6fe (patch)
treeec04cc15b867bc21eedca904cea9af0254531a11 /includes/TitleArray.php
parenta22fbfc60f36f5f7ee10d5ae6fe347340c2ee67c (diff)
Update to MediaWiki 1.18.0
* also update ArchLinux skin to chagnes in MonoBook * Use only css to hide our menu bar when printing
Diffstat (limited to 'includes/TitleArray.php')
-rw-r--r--includes/TitleArray.php22
1 files changed, 20 insertions, 2 deletions
diff --git a/includes/TitleArray.php b/includes/TitleArray.php
index f7a9e1dc..96960089 100644
--- a/includes/TitleArray.php
+++ b/includes/TitleArray.php
@@ -11,10 +11,10 @@
*/
abstract class TitleArray implements Iterator {
/**
- * @param $res result A MySQL result including at least page_namespace and
+ * @param $res ResultWrapper A SQL result including at least page_namespace and
* page_title -- also can have page_id, page_len, page_is_redirect,
* page_latest (if those will be used). See Title::newFromRow.
- * @return TitleArray
+ * @return TitleArrayFromResult
*/
static function newFromResult( $res ) {
$array = null;
@@ -27,6 +27,10 @@ abstract class TitleArray implements Iterator {
return $array;
}
+ /**
+ * @param $res ResultWrapper
+ * @return TitleArrayFromResult
+ */
protected static function newFromResult_internal( $res ) {
$array = new TitleArrayFromResult( $res );
return $array;
@@ -34,6 +38,10 @@ abstract class TitleArray implements Iterator {
}
class TitleArrayFromResult extends TitleArray {
+
+ /**
+ * @var ResultWrapper
+ */
var $res;
var $key, $current;
@@ -43,6 +51,10 @@ class TitleArrayFromResult extends TitleArray {
$this->setCurrent( $this->res->current() );
}
+ /**
+ * @param $row ResultWrapper
+ * @return void
+ */
protected function setCurrent( $row ) {
if ( $row === false ) {
$this->current = false;
@@ -51,6 +63,9 @@ class TitleArrayFromResult extends TitleArray {
}
}
+ /**
+ * @return int
+ */
public function count() {
return $this->res->numRows();
}
@@ -75,6 +90,9 @@ class TitleArrayFromResult extends TitleArray {
$this->setCurrent( $this->res->current() );
}
+ /**
+ * @return bool
+ */
function valid() {
return $this->current !== false;
}