Merge "[LockManager] Cleaned up DBLockManager and reduced code duplication."
[lhc/web/wiklou.git] / includes / api / ApiQueryProtectedTitles.php
index eba16ea..5e270e0 100644 (file)
@@ -4,7 +4,7 @@
  *
  * Created on Feb 13, 2009
  *
- * Copyright © 2009 Roan Kattouw <Firstname>.<Lastname>@gmail.com
+ * Copyright © 2009 Roan Kattouw "<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
@@ -45,6 +45,7 @@ class ApiQueryProtectedTitles extends ApiQueryGeneratorBase {
 
        /**
         * @param $resultPageSet ApiPageSet
+        * @return void
         */
        private function run( $resultPageSet = null ) {
                $params = $this->extractRequestParams();
@@ -213,6 +214,40 @@ class ApiQueryProtectedTitles extends ApiQueryGeneratorBase {
                );
        }
 
+       public function getResultProperties() {
+               global $wgRestrictionLevels;
+               return array(
+                       '' => array(
+                               'ns' => 'namespace',
+                               'title' => 'string'
+                       ),
+                       'timestamp' => array(
+                               'timestamp' => 'timestamp'
+                       ),
+                       'user' => array(
+                               'user' => array(
+                                       ApiBase::PROP_TYPE => 'string',
+                                       ApiBase::PROP_NULLABLE => true
+                               ),
+                               'userid' => 'integer'
+                       ),
+                       'comment' => array(
+                               'comment' => 'string'
+                       ),
+                       'parsedcomment' => array(
+                               'parsedcomment' => 'string'
+                       ),
+                       'expiry' => array(
+                               'expiry' => 'timestamp'
+                       ),
+                       'level' => array(
+                               'level' => array(
+                                       ApiBase::PROP_TYPE => array_diff( $wgRestrictionLevels, array( '' ) )
+                               )
+                       )
+               );
+       }
+
        public function getDescription() {
                return 'List all titles protected from creation';
        }