More parameter documentation
[lhc/web/wiklou.git] / includes / api / ApiQueryTags.php
index 51a4948..bf012dc 100644 (file)
@@ -1,9 +1,8 @@
 <?php
-
 /**
- * Created on Jul 9, 2009
  *
- * API for MediaWiki 1.8+
+ *
+ * Created on Jul 9, 2009
  *
  * Copyright © 2009
  *
@@ -21,6 +20,8 @@
  * with this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  * http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
  */
 
 if ( !defined( 'MEDIAWIKI' ) ) {
@@ -35,7 +36,12 @@ if ( !defined( 'MEDIAWIKI' ) ) {
  */
 class ApiQueryTags extends ApiQueryBase {
 
-       private $limit, $result;
+       /**
+        * @var ApiResult
+        */
+       private $result;
+
+       private $limit;
        private $fld_displayname = false, $fld_description = false,
                        $fld_hitcount = false;
 
@@ -55,10 +61,6 @@ class ApiQueryTags extends ApiQueryBase {
                $this->limit = $params['limit'];
                $this->result = $this->getResult();
 
-               $pageSet = $this->getPageSet();
-               $titles = $pageSet->getTitles();
-               $data = array();
-
                $this->addTables( 'change_tag' );
                $this->addFields( 'ct_tag' );
 
@@ -74,7 +76,7 @@ class ApiQueryTags extends ApiQueryBase {
 
                $ok = true;
 
-               while ( $row = $res->fetchObject() ) {
+               foreach ( $res as $row ) {
                        if ( !$ok ) {
                                break;
                        }
@@ -133,6 +135,10 @@ class ApiQueryTags extends ApiQueryBase {
                return true;
        }
 
+       public function getCacheMode( $params ) {
+               return 'public';
+       }
+
        public function getAllowedParams() {
                return array(
                        'continue' => array(
@@ -161,7 +167,13 @@ class ApiQueryTags extends ApiQueryBase {
                return array(
                        'continue' => 'When more results are available, use this to continue',
                        'limit' => 'The maximum number of tags to list',
-                       'prop' => 'Which properties to get',
+                       'prop' => array(
+                               'Which properties to get',
+                               ' name         - Adds name of tag',
+                               ' displayname  - Adds system messsage for the tag',
+                               ' description  - Adds description of the tag',
+                               ' hitcount     - Adds the amount of revisions that have this tag',
+                       ),
                );
        }