(bug 35885) remove api version string and parameter
[lhc/web/wiklou.git] / includes / api / ApiQueryCategoryMembers.php
index 35b5645..6a392bd 100644 (file)
@@ -4,7 +4,7 @@
  *
  * Created on June 14, 2007
  *
- * Copyright © 2006 Yuri Astrakhan <Firstname><Lastname>@gmail.com
+ * Copyright © 2006 Yuri Astrakhan "<Firstname><Lastname>@gmail.com"
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -106,11 +106,7 @@ class ApiQueryCategoryMembers extends ApiQueryGeneratorBase {
                } else {
                        if ( $params['continue'] ) {
                                $cont = explode( '|', $params['continue'], 3 );
-                               if ( count( $cont ) != 3 ) {
-                                       $this->dieUsage( 'Invalid continue param. You should pass the original value returned '.
-                                               'by the previous query', '_badcontinue'
-                                       );
-                               }
+                               $this->dieContinueUsageIf( count( $cont ) != 3 );
 
                                // Remove the types to skip from $queryTypes
                                $contTypeIndex = array_search( $cont[0], $queryTypes );
@@ -118,7 +114,7 @@ class ApiQueryCategoryMembers extends ApiQueryGeneratorBase {
 
                                // Add a WHERE clause for sortkey and from
                                // pack( "H*", $foo ) is used to convert hex back to binary
-                               $escSortkey = $this->getDB()->addQuotes( pack( "H*", $cont[1] ) );
+                               $escSortkey = $this->getDB()->addQuotes( pack( 'H*', $cont[1] ) );
                                $from = intval( $cont[2] );
                                $op = $dir == 'newer' ? '>' : '<';
                                // $contWhere is used further down
@@ -364,6 +360,36 @@ class ApiQueryCategoryMembers extends ApiQueryGeneratorBase {
                return $desc;
        }
 
+       public function getResultProperties() {
+               return array(
+                       'ids' => array(
+                               'pageid' => 'integer'
+                       ),
+                       'title' => array(
+                               'ns' => 'namespace',
+                               'title' => 'string'
+                       ),
+                       'sortkey' => array(
+                               'sortkey' => 'string'
+                       ),
+                       'sortkeyprefix' => array(
+                               'sortkeyprefix' => 'string'
+                       ),
+                       'type' => array(
+                               'type' => array(
+                                       ApiBase::PROP_TYPE => array(
+                                               'page',
+                                               'subcat',
+                                               'file'
+                                       )
+                               )
+                       ),
+                       'timestamp' => array(
+                               'timestamp' => 'timestamp'
+                       )
+               );
+       }
+
        public function getDescription() {
                return 'List all pages in a given category';
        }
@@ -373,7 +399,6 @@ class ApiQueryCategoryMembers extends ApiQueryGeneratorBase {
                        $this->getTitleOrPageIdErrorMessage(),
                        array(
                                array( 'code' => 'invalidcategory', 'info' => 'The category name you entered is not valid' ),
-                               array( 'code' => 'badcontinue', 'info' => 'Invalid continue param. You should pass the original value returned by the previous query' ),
                        )
                );
        }
@@ -388,8 +413,4 @@ class ApiQueryCategoryMembers extends ApiQueryGeneratorBase {
        public function getHelpUrls() {
                return 'https://www.mediawiki.org/wiki/API:Categorymembers';
        }
-
-       public function getVersion() {
-               return __CLASS__ . ': $Id$';
-       }
 }