Translate extension for MediaWiki
 
Loading...
Searching...
No Matches
MediaWiki\Extension\Translate\MessageProcessing\MessageGroupMetadata Class Reference

Offers functionality for reading and updating Translate group related metadata. More...

Public Member Functions

 __construct (IConnectionProvider $dbProvider)
 
 preloadGroups (array $groups, string $caller)
 
 get (string $group, string $key)
 Get a metadata value for the given group and key.
 
 getWithDefaultValue (string $group, string $key, ?string $defaultValue)
 Get a metadata value for the given group and key.
 
 set (string $groupId, string $key, $value)
 Set a metadata value for the given group and metadata key.
 
 getSubgroups (string $groupId)
 Wrapper for getting subgroups.
 
 setSubgroups (string $groupId, array $subgroupIds)
 Wrapper for setting subgroups.
 
 deleteGroup (string $groupId)
 Wrapper for deleting one wiki aggregate group at once.
 
 isExcluded (string $groupId, string $code)
 
 loadBasicMetadataForTranslatablePages (array $groupIds, array $keys)
 Do a query optimized for page list in Special:PageTranslation.
 
 moveMetadata (string $oldGroupId, string $newGroupId, array $metadataKeysToMove)
 
 clearMetadata (string $groupId, array $metadataKeys)
 
 getGroupsWithSubgroups ()
 Get groups ids that have subgroups set up.
 

Detailed Description

Offers functionality for reading and updating Translate group related metadata.

Author
Niklas Laxström
Santhosh Thottingal

Definition at line 19 of file MessageGroupMetadata.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Extension\Translate\MessageProcessing\MessageGroupMetadata::__construct ( IConnectionProvider $dbProvider)

Definition at line 27 of file MessageGroupMetadata.php.

Member Function Documentation

◆ clearMetadata()

MediaWiki\Extension\Translate\MessageProcessing\MessageGroupMetadata::clearMetadata ( string $groupId,
array $metadataKeys )
Parameters
string$groupId
string[]$metadataKeys

Definition at line 248 of file MessageGroupMetadata.php.

◆ deleteGroup()

MediaWiki\Extension\Translate\MessageProcessing\MessageGroupMetadata::deleteGroup ( string $groupId)

Wrapper for deleting one wiki aggregate group at once.

Definition at line 142 of file MessageGroupMetadata.php.

◆ get()

MediaWiki\Extension\Translate\MessageProcessing\MessageGroupMetadata::get ( string $group,
string $key )

Get a metadata value for the given group and key.

Parameters
string$groupThe group name
string$keyMetadata key
Returns
string|bool

Definition at line 64 of file MessageGroupMetadata.php.

◆ getGroupsWithSubgroups()

MediaWiki\Extension\Translate\MessageProcessing\MessageGroupMetadata::getGroupsWithSubgroups ( )

Get groups ids that have subgroups set up.

Definition at line 256 of file MessageGroupMetadata.php.

◆ getSubgroups()

MediaWiki\Extension\Translate\MessageProcessing\MessageGroupMetadata::getSubgroups ( string $groupId)

Wrapper for getting subgroups.

Returns
string[]|null

Definition at line 114 of file MessageGroupMetadata.php.

◆ getWithDefaultValue()

MediaWiki\Extension\Translate\MessageProcessing\MessageGroupMetadata::getWithDefaultValue ( string $group,
string $key,
?string $defaultValue )

Get a metadata value for the given group and key.

If it does not exist, return the default value.

Definition at line 73 of file MessageGroupMetadata.php.

◆ isExcluded()

MediaWiki\Extension\Translate\MessageProcessing\MessageGroupMetadata::isExcluded ( string $groupId,
string $code )

Definition at line 155 of file MessageGroupMetadata.php.

◆ loadBasicMetadataForTranslatablePages()

MediaWiki\Extension\Translate\MessageProcessing\MessageGroupMetadata::loadBasicMetadataForTranslatablePages ( array $groupIds,
array $keys )

Do a query optimized for page list in Special:PageTranslation.

Parameters
string[]$groupIds
string[]$keysWhich metadata keys to load
Returns
array<string,array<string,string>>

Definition at line 200 of file MessageGroupMetadata.php.

◆ moveMetadata()

MediaWiki\Extension\Translate\MessageProcessing\MessageGroupMetadata::moveMetadata ( string $oldGroupId,
string $newGroupId,
array $metadataKeysToMove )

Definition at line 229 of file MessageGroupMetadata.php.

◆ preloadGroups()

MediaWiki\Extension\Translate\MessageProcessing\MessageGroupMetadata::preloadGroups ( array $groups,
string $caller )

Definition at line 31 of file MessageGroupMetadata.php.

◆ set()

MediaWiki\Extension\Translate\MessageProcessing\MessageGroupMetadata::set ( string $groupId,
string $key,
$value )

Set a metadata value for the given group and metadata key.

Updates the value if already existing.

Parameters
string$groupIdThe group id
string$keyMetadata key
string | false$valueMetadata value, false deletes from cache

Definition at line 85 of file MessageGroupMetadata.php.

◆ setSubgroups()

MediaWiki\Extension\Translate\MessageProcessing\MessageGroupMetadata::setSubgroups ( string $groupId,
array $subgroupIds )

Wrapper for setting subgroups.

Definition at line 136 of file MessageGroupMetadata.php.


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