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

Set of Forms in which uniqueness of a Form is controlled by it's ID. More...

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

Public Member Functions

 __construct (array $forms=[])
 
 toArray ()
 
 toArrayUnordered ()
 Return the individual Forms in arbitrary order.
 
 count ()
 
 maxFormIdNumber ()
 
 add (Form $form)
 
 remove (FormId $formId)
 
 put (Form $form)
 Replace the form identified by $form->getId() with the given one or add it.
 
 getById (FormId $formId)
 
 copy ()
 
 __clone ()
 
 isEmpty ()
 
 equals ( $other)
 
 hasFormWithId (FormId $formId)
 

Private Member Functions

 sortForms (array $forms)
 
 sameForms (FormSet $other)
 

Private Attributes

 $forms = []
 

Detailed Description

Set of Forms in which uniqueness of a Form is controlled by it's ID.

Supposed to be used only inside the Lexeme class

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Lexeme\Domain\Model\FormSet::__construct ( array $forms = [])
Parameters
Form[]$forms

Member Function Documentation

◆ __clone()

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

◆ add()

Wikibase\Lexeme\Domain\Model\FormSet::add ( Form $form)

◆ copy()

Wikibase\Lexeme\Domain\Model\FormSet::copy ( )
Returns
self

◆ count()

Wikibase\Lexeme\Domain\Model\FormSet::count ( )
Returns
int

◆ equals()

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

◆ getById()

Wikibase\Lexeme\Domain\Model\FormSet::getById ( FormId $formId)
Parameters
FormId$formId
Returns
Form|null

◆ hasFormWithId()

Wikibase\Lexeme\Domain\Model\FormSet::hasFormWithId ( FormId $formId)
Parameters
FormId$formId
Returns
bool

◆ isEmpty()

Wikibase\Lexeme\Domain\Model\FormSet::isEmpty ( )
Returns
bool

◆ maxFormIdNumber()

Wikibase\Lexeme\Domain\Model\FormSet::maxFormIdNumber ( )
Returns
int

◆ put()

Wikibase\Lexeme\Domain\Model\FormSet::put ( Form $form)

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

Parameters
Form$form

◆ remove()

Wikibase\Lexeme\Domain\Model\FormSet::remove ( FormId $formId)

◆ sameForms()

Wikibase\Lexeme\Domain\Model\FormSet::sameForms ( FormSet $other)
private
Returns
bool

◆ sortForms()

Wikibase\Lexeme\Domain\Model\FormSet::sortForms ( array $forms)
private
Parameters
Form[]$forms
Returns
array sorted array mapping numeric id to the form

◆ toArray()

Wikibase\Lexeme\Domain\Model\FormSet::toArray ( )
Returns
Form[]

◆ toArrayUnordered()

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

Return the individual Forms in arbitrary order.

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

Returns
Form[]

Member Data Documentation

◆ $forms

Wikibase\Lexeme\Domain\Model\FormSet::$forms = []
private

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