Merge "API: Fix ApiQueryBacklinks logic and use *_from_namespace"
[lhc/web/wiklou.git] / includes / api / ApiQueryLangLinks.php
index 8e155f2..da05f27 100644 (file)
@@ -31,7 +31,7 @@
  */
 class ApiQueryLangLinks extends ApiQueryBase {
 
-       public function __construct( $query, $moduleName ) {
+       public function __construct( ApiQuery $query, $moduleName ) {
                parent::__construct( $query, $moduleName, 'll' );
        }
 
@@ -50,6 +50,7 @@ class ApiQueryLangLinks extends ApiQueryBase {
                // Handle deprecated param
                $this->requireMaxOneParameter( $params, 'url', 'prop' );
                if ( $params['url'] ) {
+                       $this->logFeatureUsage( 'prop=langlinks&llurl' );
                        $prop = array( 'url' => 1 );
                }
 
@@ -191,42 +192,10 @@ class ApiQueryLangLinks extends ApiQueryBase {
                );
        }
 
-       public function getResultProperties() {
-               return array(
-                       '' => array(
-                               'lang' => 'string',
-                               'url' => array(
-                                       ApiBase::PROP_TYPE => 'string',
-                                       ApiBase::PROP_NULLABLE => true
-                               ),
-                               'langname' => array(
-                                       ApiBase::PROP_TYPE => 'string',
-                                       ApiBase::PROP_NULLABLE => true
-                               ),
-                               'autonym' => array(
-                                       ApiBase::PROP_TYPE => 'string',
-                                       ApiBase::PROP_NULLABLE => true
-                               ),
-                               '*' => 'string'
-                       )
-               );
-       }
-
        public function getDescription() {
                return 'Returns all interlanguage links from the given page(s).';
        }
 
-       public function getPossibleErrors() {
-               return array_merge( parent::getPossibleErrors(),
-                       $this->getRequireMaxOneParameterErrorMessages(
-                               array( 'url', 'prop' )
-                       ),
-                       array(
-                               array( 'missingparam', 'lang' ),
-                       )
-               );
-       }
-
        public function getExamples() {
                return array(
                        'api.php?action=query&prop=langlinks&titles=Main%20Page&redirects='