ApiQueryLanguageStats.php

Go to the documentation of this file.
00001 <?php
00016 class ApiQueryLanguageStats extends ApiStatsQuery {
00017     public function __construct( $query, $moduleName ) {
00018         parent::__construct( $query, $moduleName, 'ls' );
00019     }
00020 
00021     protected function getData() {
00022         $params = $this->extractRequestParams();
00023 
00024         return MessageGroupStats::forLanguage( $params['language'] );
00025     }
00026 
00027     protected function makeItem( $item, $stats ) {
00028         $data = parent::makeItem( $item, $stats );
00029         $data['group'] = $item;
00030 
00031         return $data;
00032     }
00033 
00034     public function getAllowedParams() {
00035         $params = parent::getAllowedParams();
00036         $params['language'] = array(
00037             ApiBase::PARAM_TYPE => 'string',
00038             ApiBase::PARAM_REQUIRED => true,
00039         );
00040 
00041         return $params;
00042     }
00043 
00044     public function getParamDescription() {
00045         $desc = parent::getParamDescription();
00046         $desc['language'] = 'Language code';
00047 
00048         return $desc;
00049     }
00050 
00051     public function getDescription() {
00052         return 'Query language stats';
00053     }
00054 
00055     protected function getExamples() {
00056         return array(
00057             "api.php?action=query&meta=languagestats&lslanguage=fi List of translation " .
00058                 "completion statistics for language fi",
00059         );
00060     }
00061 }
Generated on Tue Oct 29 00:00:23 2013 for MediaWiki Translate Extension by  doxygen 1.6.3