Merge "Minor CSS cleanup for Vector and Monobook skins"
[lhc/web/wiklou.git] / includes / api / ApiPageSet.php
index bab59b7..0645edb 100644 (file)
@@ -69,6 +69,9 @@ class ApiPageSet extends ApiBase {
        private $mFakePageId = -1;
        private $mCacheMode = 'public';
        private $mRequestedPageFields = array();
+       /**
+        * @var int
+        */
        private $mDefaultNamespace = NS_MAIN;
 
        /**
@@ -217,6 +220,30 @@ class ApiPageSet extends ApiBase {
                return $this->mResolveRedirects;
        }
 
+       /**
+        * Return the parameter name that is the source of data for this PageSet
+        *
+        * If multiple source parameters are specified (e.g. titles and pageids),
+        * one will be named arbitrarily.
+        *
+        * @return string|null
+        */
+       public function getDataSource() {
+               if ( $this->mAllowGenerator && isset( $this->mParams['generator'] ) ) {
+                       return 'generator';
+               }
+               if ( isset( $this->mParams['titles'] ) ) {
+                       return 'titles';
+               }
+               if ( isset( $this->mParams['pageids'] ) ) {
+                       return 'pageids';
+               }
+               if ( isset( $this->mParams['revids'] ) ) {
+                       return 'revids';
+               }
+               return null;
+       }
+
        /**
         * Request an additional field from the page table.
         * Must be called before execute()
@@ -571,7 +598,7 @@ class ApiPageSet extends ApiBase {
                }
 
                foreach ( $this->mRequestedPageFields as $fieldName => &$fieldValues ) {
-                       $fieldValues[$pageId] = $row-> $fieldName;
+                       $fieldValues[$pageId] = $row->$fieldName;
                }
        }