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

Set of Senses in which uniqueness of a Sense is controlled by its ID. More...

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

Public Member Functions

 __construct (array $senses=[])
 
 toArray ()
 
 toArrayUnordered ()
 Return the individual Senses in arbitrary order.
 
 count ()
 
 maxSenseIdNumber ()
 
 add (Sense $sense)
 
 remove (SenseId $senseId)
 
 put (Sense $sense)
 Replace the sense identified by $sense->getId() with the given one or add it.
 
 getById (SenseId $senseId)
 
 copy ()
 
 __clone ()
 
 isEmpty ()
 
 equals ( $other)
 
 hasSenseWithId (SenseId $id)
 

Private Member Functions

 sortSenses (array $senses)
 
 sameSenses (SenseSet $other)
 

Private Attributes

array $senses = []
 

Detailed Description

Set of Senses in which uniqueness of a Sense is controlled by its ID.

Supposed to be used only inside the Lexeme class.

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Lexeme\Domain\Model\SenseSet::__construct ( array $senses = [])
Parameters
Sense[]$senses

Member Function Documentation

◆ __clone()

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

◆ add()

Wikibase\Lexeme\Domain\Model\SenseSet::add ( Sense $sense)

◆ copy()

Wikibase\Lexeme\Domain\Model\SenseSet::copy ( )

◆ count()

Wikibase\Lexeme\Domain\Model\SenseSet::count ( )

◆ equals()

Wikibase\Lexeme\Domain\Model\SenseSet::equals ( $other)

◆ getById()

Wikibase\Lexeme\Domain\Model\SenseSet::getById ( SenseId $senseId)

◆ hasSenseWithId()

Wikibase\Lexeme\Domain\Model\SenseSet::hasSenseWithId ( SenseId $id)

◆ isEmpty()

Wikibase\Lexeme\Domain\Model\SenseSet::isEmpty ( )

◆ maxSenseIdNumber()

Wikibase\Lexeme\Domain\Model\SenseSet::maxSenseIdNumber ( )

◆ put()

Wikibase\Lexeme\Domain\Model\SenseSet::put ( Sense $sense)

Replace the sense identified by $sense->getId() with the given one or add it.

◆ remove()

Wikibase\Lexeme\Domain\Model\SenseSet::remove ( SenseId $senseId)

◆ sameSenses()

Wikibase\Lexeme\Domain\Model\SenseSet::sameSenses ( SenseSet $other)
private

◆ sortSenses()

Wikibase\Lexeme\Domain\Model\SenseSet::sortSenses ( array $senses)
private
Parameters
Sense[]$senses
Returns
Sense[] sorted array mapping numeric id to the sense

◆ toArray()

Wikibase\Lexeme\Domain\Model\SenseSet::toArray ( )
Returns
Sense[]

◆ toArrayUnordered()

Wikibase\Lexeme\Domain\Model\SenseSet::toArrayUnordered ( )

Return the individual Senses in arbitrary order.

Only use this method if the order is certainly insignificant, e.g. because the Senses will be summarized or reduced in some way. Otherwise, use toArray().

Returns
Sense[]

Member Data Documentation

◆ $senses

array Wikibase\Lexeme\Domain\Model\SenseSet::$senses = []
private

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