WikibaseLexeme
MediaWiki WikibaseLexeme extension
Loading...
Searching...
No Matches
Wikibase\Lexeme\Domain\Model\Form Class Reference

Mutable (e.g. More...

+ Inheritance diagram for Wikibase\Lexeme\Domain\Model\Form:
+ Collaboration diagram for Wikibase\Lexeme\Domain\Model\Form:

Public Member Functions

 __construct (FormId $id, TermList $representations, array $grammaticalFeatures, StatementList $statementList=null)
 
 getType ()
 
 getId ()
 
 setId ( $id)
 
 getRepresentations ()
 The representations of the Form as list of terms.
 
 setRepresentations (TermList $representations)
 
 getGrammaticalFeatures ()
 
 setGrammaticalFeatures (array $grammaticalFeatures)
 
 getStatements ()
 
 isEmpty ()
 
 equals ( $target)
 
 copy ()
 
 __clone ()
 The forms ID and grammatical features (a set of ItemIds) are immutable and don't need individual cloning.
 
 clear ()
 Clears the representations, grammatical features and statements of a form.
 

Public Attributes

const ENTITY_TYPE = 'form'
 

Protected Attributes

 $id
 
 $representations
 
 $grammaticalFeatures
 
 $statementList
 

Detailed Description

Mutable (e.g.

the provided StatementList can be changed) implementation of a Lexeme's form in the lexicographical data model.

See also
https://www.mediawiki.org/wiki/Extension:WikibaseLexeme/Data_Model#Form

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Lexeme\Domain\Model\Form::__construct ( FormId $id,
TermList $representations,
array $grammaticalFeatures,
StatementList $statementList = null )
Parameters
FormId$id
TermList$representations
ItemId[]$grammaticalFeatures
StatementList | null$statementList
Exceptions
InvalidArgumentException

Member Function Documentation

◆ __clone()

Wikibase\Lexeme\Domain\Model\Form::__clone ( )

The forms ID and grammatical features (a set of ItemIds) are immutable and don't need individual cloning.

◆ clear()

Wikibase\Lexeme\Domain\Model\Form::clear ( )

Clears the representations, grammatical features and statements of a form.

Note that this leaves the form in an insufficiently initialized state.

◆ copy()

Wikibase\Lexeme\Domain\Model\Form::copy ( )
See also
EntityDocument::copy
Returns
self

◆ equals()

Wikibase\Lexeme\Domain\Model\Form::equals ( $target)
See also
EntityDocument::equals
Parameters
mixed$target
Returns
bool True if the forms contents are equal. Does not consider the ID.

◆ getGrammaticalFeatures()

Wikibase\Lexeme\Domain\Model\Form::getGrammaticalFeatures ( )
Returns
ItemId[]

◆ getId()

Wikibase\Lexeme\Domain\Model\Form::getId ( )
Returns
FormId

◆ getRepresentations()

Wikibase\Lexeme\Domain\Model\Form::getRepresentations ( )

The representations of the Form as list of terms.

Note that in some places "representation" means just the text of a representation and the language code is called "spelling variant".

Returns
TermList

◆ getStatements()

Wikibase\Lexeme\Domain\Model\Form::getStatements ( )

◆ getType()

Wikibase\Lexeme\Domain\Model\Form::getType ( )
Returns
string

◆ isEmpty()

Wikibase\Lexeme\Domain\Model\Form::isEmpty ( )
See also
EntityDocument::isEmpty
Returns
bool

◆ setGrammaticalFeatures()

Wikibase\Lexeme\Domain\Model\Form::setGrammaticalFeatures ( array $grammaticalFeatures)

◆ setId()

Wikibase\Lexeme\Domain\Model\Form::setId ( $id)
Parameters
FormId$id

Reimplemented in Wikibase\Lexeme\Domain\DummyObjects\BlankForm.

◆ setRepresentations()

Wikibase\Lexeme\Domain\Model\Form::setRepresentations ( TermList $representations)

Member Data Documentation

◆ $grammaticalFeatures

Wikibase\Lexeme\Domain\Model\Form::$grammaticalFeatures
protected

◆ $id

Wikibase\Lexeme\Domain\Model\Form::$id
protected

◆ $representations

Wikibase\Lexeme\Domain\Model\Form::$representations
protected

◆ $statementList

Wikibase\Lexeme\Domain\Model\Form::$statementList
protected

◆ ENTITY_TYPE

const Wikibase\Lexeme\Domain\Model\Form::ENTITY_TYPE = 'form'

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