Translate extension for MediaWiki
 
Loading...
Searching...
No Matches
AggregateMessageGroupLoader Class Reference

Loads AggregateMessageGroup, and handles the related cache. More...

Inheritance diagram for AggregateMessageGroupLoader:
MessageGroupLoader CachedMessageGroupLoader

Public Member Functions

 __construct (IDatabase $db, MessageGroupWANCache $cache)
 
 getGroups ()
 Fetches the AggregateMessageGroups.
 
 getCacheData ()
 Get all the aggregate messages groups defined in translate_metadata table and return their configuration.
 
 loadAggregateGroups ()
 Loads AggregateMessageGroup from the database.
 
 recache ()
 Clear and refill the cache with the latest values.
 
 clearCache ()
 Clear values from the cache.
 
- Public Member Functions inherited from MessageGroupLoader
 isExpired (DependencyWrapper $wrapper)
 Determines if dependencies have expired.
 

Static Public Member Functions

static registerLoader (array &$groupLoader, array $deps)
 Hook: TranslateInitGroupLoaders.
 
static getInstance (IDatabase $db=null, WANObjectCache $cache=null)
 Return an instance of this class using the parameters, if passed, else initialize the necessary dependencies and return an instance.
 

Protected Member Functions

 initGroupsFromConf (array $groups)
 
 clearProcessCache ()
 Clears the process cache, mainly the cached groups property.
 

Protected Attributes

 $cache
 
 $db
 
 $groups
 

Detailed Description

Loads AggregateMessageGroup, and handles the related cache.

Since
2019.05

Definition at line 18 of file AggregateMessageGroupLoader.php.

Constructor & Destructor Documentation

◆ __construct()

AggregateMessageGroupLoader::__construct ( IDatabase $db,
MessageGroupWANCache $cache )

Definition at line 31 of file AggregateMessageGroupLoader.php.

Member Function Documentation

◆ clearCache()

AggregateMessageGroupLoader::clearCache ( )

Clear values from the cache.

Implements CachedMessageGroupLoader.

Definition at line 150 of file AggregateMessageGroupLoader.php.

◆ clearProcessCache()

AggregateMessageGroupLoader::clearProcessCache ( )
protected

Clears the process cache, mainly the cached groups property.

Definition at line 158 of file AggregateMessageGroupLoader.php.

◆ getCacheData()

AggregateMessageGroupLoader::getCacheData ( )

Get all the aggregate messages groups defined in translate_metadata table and return their configuration.

Returns
array[]

Definition at line 92 of file AggregateMessageGroupLoader.php.

◆ getGroups()

AggregateMessageGroupLoader::getGroups ( )

Fetches the AggregateMessageGroups.

Returns
AggregateMessageGroup[] Key is the MessageGroup ID and value is the corresponding AggregateMessageGroup

Reimplemented from MessageGroupLoader.

Definition at line 49 of file AggregateMessageGroupLoader.php.

◆ getInstance()

static AggregateMessageGroupLoader::getInstance ( IDatabase $db = null,
WANObjectCache $cache = null )
static

Return an instance of this class using the parameters, if passed, else initialize the necessary dependencies and return an instance.

Parameters
IDatabase | null$db
WANObjectCache | null$cache
Returns
self

Definition at line 78 of file AggregateMessageGroupLoader.php.

◆ initGroupsFromConf()

AggregateMessageGroupLoader::initGroupsFromConf ( array $groups)
protected
Parameters
array[]$groups
Returns
MessageGroup[]

Definition at line 132 of file AggregateMessageGroupLoader.php.

◆ loadAggregateGroups()

AggregateMessageGroupLoader::loadAggregateGroups ( )

Loads AggregateMessageGroup from the database.

Returns
AggregateMessageGroup[]

Definition at line 122 of file AggregateMessageGroupLoader.php.

◆ recache()

AggregateMessageGroupLoader::recache ( )

Clear and refill the cache with the latest values.

Implements CachedMessageGroupLoader.

Definition at line 139 of file AggregateMessageGroupLoader.php.

◆ registerLoader()

static AggregateMessageGroupLoader::registerLoader ( array & $groupLoader,
array $deps )
static

Hook: TranslateInitGroupLoaders.

Parameters
array&$groupLoader
array$depsDependencies

Definition at line 63 of file AggregateMessageGroupLoader.php.

Member Data Documentation

◆ $cache

AggregateMessageGroupLoader::$cache
protected

Definition at line 25 of file AggregateMessageGroupLoader.php.

◆ $db

AggregateMessageGroupLoader::$db
protected

Definition at line 27 of file AggregateMessageGroupLoader.php.

◆ $groups

AggregateMessageGroupLoader::$groups
protected

Definition at line 29 of file AggregateMessageGroupLoader.php.


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