Wikibase
MediaWiki Wikibase extension
Wikibase\Repo\Validators\TermValidatorFactory Class Reference

Provides validators for terms (like the maximum length of labels, etc). More...

Public Member Functions

 __construct ( $maxLength, array $languageCodes, EntityIdParser $idParser, TermsCollisionDetectorFactory $termsCollisionDetectorFactory, TermLookup $termLookup)
 
 getFingerprintUniquenessValidator (string $entityType)
 This function returns a fingerprint uniqueness validator that validates uniqueness in the term store. More...
 
 getLabelDescriptionNotEqualValidator ()
 Returns a validator for checking distinctness of labels & descriptions. More...
 
 getLabelValidator ( $entityType)
 
 getDescriptionValidator ()
 
 getAliasValidator ()
 
 getLanguageValidator ()
 

Private Member Functions

 getCommonTermValidators ( $errorCodePrefix)
 

Private Attributes

 $maxLength
 
 $languageCodes
 
 $idParser
 
 $termsCollisionDetectorFactory
 
 $termLookup
 

Detailed Description

Provides validators for terms (like the maximum length of labels, etc).

Author
Daniel Kinzler

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Repo\Validators\TermValidatorFactory::__construct (   $maxLength,
array  $languageCodes,
EntityIdParser  $idParser,
TermsCollisionDetectorFactory  $termsCollisionDetectorFactory,
TermLookup  $termLookup 
)
Parameters
int$maxLengthThe maximum length of terms.
string[]$languageCodesA list of valid language codes
EntityIdParser$idParser
TermsCollisionDetectorFactory$termsCollisionDetectorFactory
TermLookup$termLookup
Exceptions
InvalidArgumentException

Member Function Documentation

◆ getAliasValidator()

Wikibase\Repo\Validators\TermValidatorFactory::getAliasValidator ( )
Returns
ValueValidator

◆ getCommonTermValidators()

Wikibase\Repo\Validators\TermValidatorFactory::getCommonTermValidators (   $errorCodePrefix)
private
Parameters
string$errorCodePrefix
Returns
ValueValidator[]

◆ getDescriptionValidator()

Wikibase\Repo\Validators\TermValidatorFactory::getDescriptionValidator ( )
Returns
ValueValidator

◆ getFingerprintUniquenessValidator()

Wikibase\Repo\Validators\TermValidatorFactory::getFingerprintUniquenessValidator ( string  $entityType)

This function returns a fingerprint uniqueness validator that validates uniqueness in the term store.

◆ getLabelDescriptionNotEqualValidator()

Wikibase\Repo\Validators\TermValidatorFactory::getLabelDescriptionNotEqualValidator ( )

Returns a validator for checking distinctness of labels & descriptions.

Note
The validator provided here is intended to apply checks in ADDITION to the ones performed by the validators returned by the getLabelValidator() etc functions below.
Returns
LabelDescriptionNotEqualValidator

◆ getLabelValidator()

Wikibase\Repo\Validators\TermValidatorFactory::getLabelValidator (   $entityType)
Parameters
string$entityType
Returns
ValueValidator

◆ getLanguageValidator()

Wikibase\Repo\Validators\TermValidatorFactory::getLanguageValidator ( )
Returns
ValueValidator

Member Data Documentation

◆ $idParser

Wikibase\Repo\Validators\TermValidatorFactory::$idParser
private

◆ $languageCodes

Wikibase\Repo\Validators\TermValidatorFactory::$languageCodes
private

◆ $maxLength

Wikibase\Repo\Validators\TermValidatorFactory::$maxLength
private

◆ $termLookup

Wikibase\Repo\Validators\TermValidatorFactory::$termLookup
private

◆ $termsCollisionDetectorFactory

Wikibase\Repo\Validators\TermValidatorFactory::$termsCollisionDetectorFactory
private

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