Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
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, LanguageNameUtils $languageNameUtils)
 
 getFingerprintUniquenessValidator (string $entityType)
 This function returns a fingerprint uniqueness validator that validates uniqueness in the term store.
 
 getLabelDescriptionNotEqualValidator ()
 Returns a validator for checking distinctness of labels & descriptions.
 
 getLabelValidator ( $entityType)
 
 getDescriptionValidator ()
 
 getAliasValidator ()
 
 getLabelLanguageValidator ()
 
 getDescriptionLanguageValidator ()
 
 getAliasLanguageValidator ()
 
 getLabelUniquenessValidator ( $entityType)
 

Private Member Functions

 getCommonTermValidators ( $errorCodePrefix)
 
 getLanguageValidators ()
 

Private Attributes

 $maxLength
 
 $languageCodes
 
 $idParser
 
 $termsCollisionDetectorFactory
 
 $termLookup
 
 $languageNameUtils
 

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,
LanguageNameUtils  $languageNameUtils 
)
Parameters
int$maxLengthThe maximum length of terms.
string[]$languageCodesA list of valid language codes
EntityIdParser$idParser
TermsCollisionDetectorFactory$termsCollisionDetectorFactory
TermLookup$termLookup
LanguageNameUtils$languageNameUtils
Exceptions
InvalidArgumentException

Member Function Documentation

◆ getAliasLanguageValidator()

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

◆ getAliasValidator()

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

◆ getCommonTermValidators()

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

◆ getDescriptionLanguageValidator()

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

◆ 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

◆ getLabelLanguageValidator()

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

◆ getLabelUniquenessValidator()

Wikibase\Repo\Validators\TermValidatorFactory::getLabelUniquenessValidator (   $entityType)

◆ getLabelValidator()

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

◆ getLanguageValidators()

Wikibase\Repo\Validators\TermValidatorFactory::getLanguageValidators ( )
private
Returns
ValueValidator[]

Member Data Documentation

◆ $idParser

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

◆ $languageCodes

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

◆ $languageNameUtils

Wikibase\Repo\Validators\TermValidatorFactory::$languageNameUtils
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: