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

Static Public Member Functions

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

Detailed Description

Definition at line 18 of file TranslateMetadata.php.

Member Function Documentation

◆ clearMetadata()

static TranslateMetadata::clearMetadata ( string $groupId,
array $metadataKeys )
static
Parameters
string$groupId
string[]$metadataKeys

Definition at line 243 of file TranslateMetadata.php.

◆ deleteGroup()

static TranslateMetadata::deleteGroup ( string $groupId)
static

Wrapper for deleting one wiki aggregate group at once.

Definition at line 135 of file TranslateMetadata.php.

◆ get()

static TranslateMetadata::get ( string $group,
string $key )
static

Get a metadata value for the given group and key.

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

Definition at line 57 of file TranslateMetadata.php.

◆ getGroupsWithSubgroups()

static TranslateMetadata::getGroupsWithSubgroups ( )
static

Get groups ids that have subgroups set up.

Definition at line 251 of file TranslateMetadata.php.

◆ getSubgroups()

static TranslateMetadata::getSubgroups ( string $groupId)
static

Wrapper for getting subgroups.

Returns
string[]|null

Definition at line 107 of file TranslateMetadata.php.

◆ getWithDefaultValue()

static TranslateMetadata::getWithDefaultValue ( string $group,
string $key,
string $defaultValue )
static

Get a metadata value for the given group and key.

If it does not exist, return the default value.

Definition at line 66 of file TranslateMetadata.php.

◆ isExcluded()

static TranslateMetadata::isExcluded ( string $groupId,
string $code )
static

Definition at line 147 of file TranslateMetadata.php.

◆ loadBasicMetadataForTranslatablePages()

static TranslateMetadata::loadBasicMetadataForTranslatablePages ( array $groupIds,
array $keys )
static

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 196 of file TranslateMetadata.php.

◆ moveMetadata()

static TranslateMetadata::moveMetadata ( string $oldGroupId,
string $newGroupId,
array $metadataKeysToMove )
static

Definition at line 224 of file TranslateMetadata.php.

◆ preloadGroups()

static TranslateMetadata::preloadGroups ( array $groups,
string $caller )
static
Parameters
string[]$groupsList of translate groups
string$caller

Definition at line 27 of file TranslateMetadata.php.

◆ set()

static TranslateMetadata::set ( string $groupId,
string $key,
$value )
static

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 80 of file TranslateMetadata.php.

◆ setSubgroups()

static TranslateMetadata::setSubgroups ( string $groupId,
array $subgroupIds )
static

Wrapper for setting subgroups.

Definition at line 129 of file TranslateMetadata.php.


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