Translate extension for MediaWiki
 
Loading...
Searching...
No Matches
MediaWiki\Extension\Translate\MessageGroupProcessing\AggregateGroupManager Class Reference

Contains logic to manage aggregate groups and their subgroups. More...

Public Member Functions

 __construct (private readonly TitleFactory $titleFactory, private readonly MessageGroupMetadata $messageGroupMetadata,)
 
 supportsAggregation (MessageGroup $group)
 
 getTargetTitleByGroupId (string $groupId)
 
 getTargetTitleByGroup (MessageGroup $group)
 
 add (string $name, string $description, ?string $languageCode)
 
 associate (string $aggregateGroupId, array $newSubgroupIds)
 
 disassociate (string $aggregateGroupId, array $subgroupIds)
 
 hasGroupsSupportingAggregation ()
 Checks if there are any pages that support aggregation.
 
 getAll ()
 Return a list of all Aggregate groups.
 

Detailed Description

Contains logic to manage aggregate groups and their subgroups.

Author
Abijeet Patro @license GPL-2.0-or-later
Since
2024.06

Definition at line 21 of file AggregateGroupManager.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Extension\Translate\MessageGroupProcessing\AggregateGroupManager::__construct ( private readonly TitleFactory $titleFactory,
private readonly MessageGroupMetadata $messageGroupMetadata )

Definition at line 25 of file AggregateGroupManager.php.

Member Function Documentation

◆ add()

MediaWiki\Extension\Translate\MessageGroupProcessing\AggregateGroupManager::add ( string $name,
string $description,
?string $languageCode )
Exceptions
DuplicateAggregateGroupException

Definition at line 58 of file AggregateGroupManager.php.

◆ associate()

MediaWiki\Extension\Translate\MessageGroupProcessing\AggregateGroupManager::associate ( string $aggregateGroupId,
array $newSubgroupIds )
Parameters
string$aggregateGroupId
string[]$newSubgroupIds
Returns
string[] List of subgroup ids that were associated
Exceptions
AggregateGroupAssociationFailure
AggregateGroupLanguageMismatchException
AggregateGroupNotFoundException

Definition at line 86 of file AggregateGroupManager.php.

◆ disassociate()

MediaWiki\Extension\Translate\MessageGroupProcessing\AggregateGroupManager::disassociate ( string $aggregateGroupId,
array $subgroupIds )
Parameters
string$aggregateGroupId
string[]$subgroupIds
Returns
string[] List of subgroup ids that were dis-associated

Definition at line 136 of file AggregateGroupManager.php.

◆ getAll()

MediaWiki\Extension\Translate\MessageGroupProcessing\AggregateGroupManager::getAll ( )

Return a list of all Aggregate groups.

Returns
AggregateMessageGroup[]

Definition at line 159 of file AggregateGroupManager.php.

◆ getTargetTitleByGroup()

MediaWiki\Extension\Translate\MessageGroupProcessing\AggregateGroupManager::getTargetTitleByGroup ( MessageGroup $group)
Exceptions
RuntimeExceptionIf MessageGroup::getRelatedPage returns null

Definition at line 48 of file AggregateGroupManager.php.

◆ getTargetTitleByGroupId()

MediaWiki\Extension\Translate\MessageGroupProcessing\AggregateGroupManager::getTargetTitleByGroupId ( string $groupId)

Definition at line 35 of file AggregateGroupManager.php.

◆ hasGroupsSupportingAggregation()

MediaWiki\Extension\Translate\MessageGroupProcessing\AggregateGroupManager::hasGroupsSupportingAggregation ( )

Checks if there are any pages that support aggregation.

Definition at line 144 of file AggregateGroupManager.php.

◆ supportsAggregation()

MediaWiki\Extension\Translate\MessageGroupProcessing\AggregateGroupManager::supportsAggregation ( MessageGroup $group)

Definition at line 31 of file AggregateGroupManager.php.


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