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 (private readonly IConnectionProvider $dbProvider)
 
 preloadGroups (array $groups, string $caller)
 
 get (MessageGroup|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 (MessageGroup|string $group, string $key, string|false $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 (MessageGroup|string $group, 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 21 of file MessageGroupMetadata.php.

Constructor & Destructor Documentation

◆ __construct()

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

Definition at line 28 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 251 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 146 of file MessageGroupMetadata.php.

◆ get()

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

Get a metadata value for the given group and key.

Parameters
MessageGroup | string$group
string$keyMetadata key

Definition at line 67 of file MessageGroupMetadata.php.

◆ getGroupsWithSubgroups()

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

Get groups ids that have subgroups set up.

Definition at line 259 of file MessageGroupMetadata.php.

◆ getSubgroups()

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

Wrapper for getting subgroups.

Returns
string[]|null

Definition at line 118 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 77 of file MessageGroupMetadata.php.

◆ isExcluded()

MediaWiki\Extension\Translate\MessageProcessing\MessageGroupMetadata::isExcluded ( MessageGroup|string $group,
string $code )

Definition at line 159 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 202 of file MessageGroupMetadata.php.

◆ moveMetadata()

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

Definition at line 232 of file MessageGroupMetadata.php.

◆ preloadGroups()

MediaWiki\Extension\Translate\MessageProcessing\MessageGroupMetadata::preloadGroups ( array $groups,
string $caller )
Parameters
array<MessageGroup|string>$groups
string$caller

Definition at line 35 of file MessageGroupMetadata.php.

◆ set()

MediaWiki\Extension\Translate\MessageProcessing\MessageGroupMetadata::set ( MessageGroup|string $group,
string $key,
string|false $value )

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

Updates the value if already existing.

Parameters
MessageGroup | string$group
string$keyMetadata key
string | false$valueMetadata value, false to delete

Definition at line 89 of file MessageGroupMetadata.php.

◆ setSubgroups()

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

Wrapper for setting subgroups.

Definition at line 140 of file MessageGroupMetadata.php.


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