Unordered list of Term objects.
More...
Unordered list of Term objects.
If multiple terms with the same language code are provided, only the last one will be retained. Empty terms are skipped and treated as non-existing.
- Since
- 0.7.3
- Copyright
- GPL-2.0-or-later
- Author
- Jeroen De Dauw < jeroe.nosp@m.nded.nosp@m.auw@g.nosp@m.mail.nosp@m..com >
◆ __construct()
Wikibase\DataModel\Term\TermList::__construct |
( |
|
$terms = [] | ) |
|
- Parameters
-
iterable | Term[] | $terms | Can be a non-array since 8.1 |
- Exceptions
-
◆ addAll()
Wikibase\DataModel\Term\TermList::addAll |
( |
|
$terms | ) |
|
- Since
- 8.1
- Parameters
-
- Exceptions
-
◆ clear()
Wikibase\DataModel\Term\TermList::clear |
( |
| ) |
|
Removes all terms from this list.
- Since
- 7.0
◆ count()
Wikibase\DataModel\Term\TermList::count |
( |
| ) |
|
- See also
- Countable::count
- Returns
- int
◆ equals()
Wikibase\DataModel\Term\TermList::equals |
( |
|
$target | ) |
|
- Since
- 0.7.4
- Parameters
-
- Returns
- bool
◆ getByLanguage()
Wikibase\DataModel\Term\TermList::getByLanguage |
( |
|
$languageCode | ) |
|
- Parameters
-
- Returns
- Term
- Exceptions
-
◆ getIterator()
Wikibase\DataModel\Term\TermList::getIterator |
( |
| ) |
|
- See also
- IteratorAggregate::getIterator
- Returns
- Iterator|Term[]
◆ getWithLanguages()
Wikibase\DataModel\Term\TermList::getWithLanguages |
( |
array |
$languageCodes | ) |
|
- Since
- 2.5
- Parameters
-
- Returns
- self
◆ hasTerm()
Wikibase\DataModel\Term\TermList::hasTerm |
( |
Term |
$term | ) |
|
- Since
- 0.7.4
- Parameters
-
- Returns
- boolean
◆ hasTermForLanguage()
Wikibase\DataModel\Term\TermList::hasTermForLanguage |
( |
|
$languageCode | ) |
|
◆ isEmpty()
Wikibase\DataModel\Term\TermList::isEmpty |
( |
| ) |
|
◆ removeByLanguage()
Wikibase\DataModel\Term\TermList::removeByLanguage |
( |
|
$languageCode | ) |
|
◆ setTerm()
Wikibase\DataModel\Term\TermList::setTerm |
( |
Term |
$term | ) |
|
Replaces non-empty or removes empty terms.
- Parameters
-
◆ setTextForLanguage()
Wikibase\DataModel\Term\TermList::setTextForLanguage |
( |
|
$languageCode, |
|
|
|
$termText |
|
) |
| |
- Since
- 0.8
- Parameters
-
string | $languageCode | |
string | $termText | |
◆ toTextArray()
Wikibase\DataModel\Term\TermList::toTextArray |
( |
| ) |
|
Returns an array with language codes as keys and the term text as values.
- Returns
- string[]
◆ $terms
Wikibase\DataModel\Term\TermList::$terms = [] |
|
private |
The documentation for this class was generated from the following file: