Merge "For consistency of the interface, don't do expensive checks on page view."
[lhc/web/wiklou.git] / includes / api / ApiQueryCategoryMembers.php
index 0f7800f..9f66f22 100644 (file)
@@ -97,7 +97,7 @@ class ApiQueryCategoryMembers extends ApiQueryGeneratorBase {
                $dir = in_array( $params['dir'], array( 'asc', 'ascending', 'newer' ) ) ? 'newer' : 'older';
 
                if ( $params['sort'] == 'timestamp' ) {
-                       $this->addWhereRange( 'cl_timestamp',
+                       $this->addTimestampWhereRange( 'cl_timestamp',
                                $dir,
                                $params['start'],
                                $params['end'] );
@@ -364,6 +364,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';
        }