Wikibase
MediaWiki Wikibase extension
Wikibase\DataModel\Term\AliasGroupList Class Reference

Unordered list of AliasGroup objects. More...

+ Inheritance diagram for Wikibase\DataModel\Term\AliasGroupList:
+ Collaboration diagram for Wikibase\DataModel\Term\AliasGroupList:

Public Member Functions

 __construct (array $aliasGroups=[])
 
 count ()
 
 getIterator ()
 
 toArray ()
 The array keys are the language codes of their associated AliasGroup. More...
 
 getByLanguage ( $languageCode)
 
 getWithLanguages (array $languageCodes)
 
 removeByLanguage ( $languageCode)
 
 setGroup (AliasGroup $group)
 If the group is empty, it will not be stored. More...
 
 equals ( $target)
 
 isEmpty ()
 
 hasAliasGroup (AliasGroup $group)
 
 hasGroupForLanguage ( $languageCode)
 
 setAliasesForLanguage ( $languageCode, array $aliases)
 
 toTextArray ()
 Returns an array with language codes as keys the aliases as array values. More...
 
 clear ()
 Removes all alias groups from this list. More...
 

Private Attributes

 $groups = []
 

Detailed Description

Unordered list of AliasGroup objects.

Only one group per language code. If multiple groups with the same language code are provided, only the last one will be retained.

Empty groups are not stored.

Since
0.7.3
Author
Jeroen De Dauw < jeroe.nosp@m.nded.nosp@m.auw@g.nosp@m.mail.nosp@m..com >

Constructor & Destructor Documentation

◆ __construct()

Wikibase\DataModel\Term\AliasGroupList::__construct ( array  $aliasGroups = [])
Parameters
AliasGroup[]$aliasGroups
Exceptions
InvalidArgumentException

Member Function Documentation

◆ clear()

Wikibase\DataModel\Term\AliasGroupList::clear ( )

Removes all alias groups from this list.

Since
7.0

◆ count()

Wikibase\DataModel\Term\AliasGroupList::count ( )
See also
Countable::count
Returns
int

◆ equals()

Wikibase\DataModel\Term\AliasGroupList::equals (   $target)
Since
0.7.4
Parameters
mixed$target
Returns
bool

◆ getByLanguage()

Wikibase\DataModel\Term\AliasGroupList::getByLanguage (   $languageCode)
Parameters
string$languageCode
Returns
AliasGroup
Exceptions
OutOfBoundsException

◆ getIterator()

Wikibase\DataModel\Term\AliasGroupList::getIterator ( )
See also
IteratorAggregate::getIterator
Returns
Iterator|AliasGroup[]

◆ getWithLanguages()

Wikibase\DataModel\Term\AliasGroupList::getWithLanguages ( array  $languageCodes)
Since
2.5
Parameters
string[]$languageCodes
Returns
self

◆ hasAliasGroup()

Wikibase\DataModel\Term\AliasGroupList::hasAliasGroup ( AliasGroup  $group)
Since
0.7.4
Parameters
AliasGroup$group
Returns
boolean

◆ hasGroupForLanguage()

Wikibase\DataModel\Term\AliasGroupList::hasGroupForLanguage (   $languageCode)
Since
0.8
Parameters
string$languageCode
Returns
boolean

◆ isEmpty()

Wikibase\DataModel\Term\AliasGroupList::isEmpty ( )
Since
2.4.0
Returns
bool

◆ removeByLanguage()

Wikibase\DataModel\Term\AliasGroupList::removeByLanguage (   $languageCode)
Parameters
string$languageCode

◆ setAliasesForLanguage()

Wikibase\DataModel\Term\AliasGroupList::setAliasesForLanguage (   $languageCode,
array  $aliases 
)
Since
0.8
Parameters
string$languageCode
string[]$aliases

◆ setGroup()

Wikibase\DataModel\Term\AliasGroupList::setGroup ( AliasGroup  $group)

If the group is empty, it will not be stored.

In case the language of that group had an associated group, that group will be removed.

Parameters
AliasGroup$group

◆ toArray()

Wikibase\DataModel\Term\AliasGroupList::toArray ( )

The array keys are the language codes of their associated AliasGroup.

Since
2.3
Returns
AliasGroup[] Array indexed by language code.

◆ toTextArray()

Wikibase\DataModel\Term\AliasGroupList::toTextArray ( )

Returns an array with language codes as keys the aliases as array values.

Since
2.5
Returns
array[]

Member Data Documentation

◆ $groups

Wikibase\DataModel\Term\AliasGroupList::$groups = []
private

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