MediaWiki  1.34.0
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...
 
 handlePageCreation (LinkTarget $target)
 Given that the provided page was created, invalidate caches if necessary. More...
 
 handlePageDeletion (LinkTarget $target)
 Given that the provided page was updated, invalidate caches if necessary. More...
 
 handlePageUpdate (LinkTarget $target)
 Given that the provided page was updated, invalidate caches if necessary. 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 5 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 69 of file GadgetRepo.php.

References getGadget(), and getGadgetIds().

◆ handlePageCreation()

GadgetRepo::handlePageCreation ( LinkTarget  $target)

Given that the provided page was created, invalidate caches if necessary.

Parameters
LinkTarget$target
Returns
void

Reimplemented in GadgetDefinitionNamespaceRepo.

Definition at line 50 of file GadgetRepo.php.

◆ handlePageDeletion()

GadgetRepo::handlePageDeletion ( LinkTarget  $target)

Given that the provided page was updated, invalidate caches if necessary.

Parameters
LinkTarget$target
Returns
void

Reimplemented in GadgetDefinitionNamespaceRepo.

Definition at line 61 of file GadgetRepo.php.

◆ handlePageUpdate()

GadgetRepo::handlePageUpdate ( LinkTarget  $target)

Given that the provided page was updated, invalidate caches if necessary.

Parameters
LinkTarget$target
Returns
void

Reimplemented in GadgetDefinitionNamespaceRepo, and MediaWikiGadgetsDefinitionRepo.

Definition at line 39 of file GadgetRepo.php.

◆ setSingleton()

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

Should only be used by unit tests.

Parameters
GadgetRepo | null$repo

Definition at line 101 of file GadgetRepo.php.

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

◆ singleton()

Member Data Documentation

◆ $instance

GadgetRepo null GadgetRepo::$instance
staticprivate

Definition at line 10 of file GadgetRepo.php.

Referenced by singleton().


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