MediaWiki  1.29.2
GadgetRepo Class Reference
Inheritance diagram for GadgetRepo:
Collaboration diagram for GadgetRepo:

Public Member Functions

 getGadget ( $id)
 Get the Gadget object for a given gadget id. More...
 
 getGadgetIds ()
 Get the ids of the gadgets provided by this repository. More...
 
 getStructuredList ()
 Get a list of gadgets sorted by category. More...
 

Static Public Member Functions

static setSingleton ( $repo=null)
 Should only be used by unit tests. More...
 
static singleton ()
 Get the configured default GadgetRepo. More...
 

Static Private Attributes

static GadgetRepo null $instance
 

Detailed Description

Definition at line 3 of file GadgetRepo.php.

Member Function Documentation

◆ getGadget()

GadgetRepo::getGadget (   $id)
abstract

Get the Gadget object for a given gadget id.

Parameters
string$id
Exceptions
InvalidArgumentException
Returns
Gadget

Reimplemented in GadgetDefinitionNamespaceRepo, and MediaWikiGadgetsDefinitionRepo.

Referenced by getStructuredList().

◆ getGadgetIds()

GadgetRepo::getGadgetIds ( )
abstract

Get the ids of the gadgets provided by this repository.

It's possible this could be out of sync with what getGadget() will return due to caching

Returns
string[]

Reimplemented in GadgetDefinitionNamespaceRepo, and MediaWikiGadgetsDefinitionRepo.

Referenced by getStructuredList().

◆ getStructuredList()

GadgetRepo::getStructuredList ( )

Get a list of gadgets sorted by category.

Returns
array [ 'category' => [ 'name' => $gadget ] ]

Definition at line 34 of file GadgetRepo.php.

References $e, as, getGadget(), and getGadgetIds().

◆ setSingleton()

static GadgetRepo::setSingleton (   $repo = null)
static

Should only be used by unit tests.

Parameters
GadgetRepo | null$repo

Definition at line 66 of file GadgetRepo.php.

Referenced by GadgetsTest\tearDown(), and GadgetsTest\testPreferences().

◆ singleton()

Member Data Documentation

◆ $instance

GadgetRepo null GadgetRepo::$instance
staticprivate

Definition at line 8 of file GadgetRepo.php.

Referenced by singleton().


The documentation for this class was generated from the following file: