Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Wikibase\DataModel\Term\Term Class Reference

Immutable value object. More...

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

Public Member Functions

 __construct ( $languageCode, $text)
 
 getLanguageCode ()
 Language code.
 
 getText ()
 
 equals ( $target)
 

Private Attributes

 $languageCode
 
 $text
 

Detailed Description

Immutable value object.

Beware that TermFallback extends this class in an unintuitive way which arguably even violates the Liskov substitution principle.

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\Term::__construct ( $languageCode,
$text )
Parameters
string$languageCodeLanguage of the text.
string$text
Exceptions
InvalidArgumentException

Member Function Documentation

◆ equals()

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

Reimplemented in Wikibase\DataModel\Term\TermFallback.

◆ getLanguageCode()

Wikibase\DataModel\Term\Term::getLanguageCode ( )

Language code.

Note that in TermFallback, this is the requested language code, and there is a separate TermFallback::getActualLanguageCode() method.

Returns
string

◆ getText()

Wikibase\DataModel\Term\Term::getText ( )
Returns
string

Member Data Documentation

◆ $languageCode

Wikibase\DataModel\Term\Term::$languageCode
private

◆ $text

Wikibase\DataModel\Term\Term::$text
private

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