summaryrefslogtreecommitdiff
path: root/extensions/Gadgets/api/ApiQueryGadgetCategories.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2015-12-20 09:00:55 +0100
committerPierre Schmitz <pierre@archlinux.de>2015-12-20 09:00:55 +0100
commita2190ac74dd4d7080b12bab90e552d7aa81209ef (patch)
tree8b31f38de9882d18df54cf8d9e0de74167a094eb /extensions/Gadgets/api/ApiQueryGadgetCategories.php
parent15e69f7b20b6596b9148030acce5b59993b95a45 (diff)
parent257401d8b2cf661adf36c84b0e3fd1cf85e33c22 (diff)
Merge branch 'mw-1.26'
Diffstat (limited to 'extensions/Gadgets/api/ApiQueryGadgetCategories.php')
-rw-r--r--extensions/Gadgets/api/ApiQueryGadgetCategories.php54
1 files changed, 12 insertions, 42 deletions
diff --git a/extensions/Gadgets/api/ApiQueryGadgetCategories.php b/extensions/Gadgets/api/ApiQueryGadgetCategories.php
index 23257f12..82c7bff8 100644
--- a/extensions/Gadgets/api/ApiQueryGadgetCategories.php
+++ b/extensions/Gadgets/api/ApiQueryGadgetCategories.php
@@ -20,11 +20,18 @@
*/
class ApiQueryGadgetCategories extends ApiQueryBase {
- private $props,
- $neededNames;
+ /**
+ * @var array
+ */
+ private $props;
+
+ /**
+ * @var array|bool
+ */
+ private $neededNames;
- public function __construct( $query, $moduleName ) {
- parent::__construct( $query, $moduleName, 'gc' );
+ public function __construct( ApiQuery $queryModule, $moduleName ) {
+ parent::__construct( $queryModule, $moduleName, 'gc' );
}
public function execute() {
@@ -42,7 +49,7 @@ class ApiQueryGadgetCategories extends ApiQueryBase {
private function getList() {
$data = array();
$result = $this->getResult();
- $gadgets = Gadget::loadStructuredList();
+ $gadgets = GadgetRepo::singleton()->getStructuredList();
if ( $gadgets ) {
foreach ( $gadgets as $category => $list ) {
@@ -89,43 +96,6 @@ class ApiQueryGadgetCategories extends ApiQueryBase {
}
/**
- * @deprecated since MediaWiki core 1.25
- */
- public function getDescription() {
- return 'Returns a list of gadget categories';
- }
-
- /**
- * @deprecated since MediaWiki core 1.25
- */
- public function getParamDescription() {
- return array(
- 'prop' => array(
- 'What gadget category information to get:',
- ' name - Internal category name',
- ' title - Category title',
- ' members - Number of gadgets in category',
- ),
- 'names' => 'Name(s) of categories to retrieve',
- );
- }
-
- /**
- * @deprecated since MediaWiki core 1.25
- */
- public function getExamples() {
- $params = $this->getAllowedParams();
- $allProps = implode( '|', $params['prop'][ApiBase::PARAM_TYPE] );
-
- return array(
- 'Get a list of existing gadget categories:',
- ' api.php?action=query&list=gadgetcategories',
- 'Get all information about categories named "foo" and "bar":',
- " api.php?action=query&list=gadgetcategories&gcnames=foo|bar&gcprop=$allProps",
- );
- }
-
- /**
* @see ApiBase::getExamplesMessages()
*/
protected function getExamplesMessages() {