Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Wikibase\Repo\RestApi\Infrastructure\ItemDeserializerItemValidator Class Reference
+ Inheritance diagram for Wikibase\Repo\RestApi\Infrastructure\ItemDeserializerItemValidator:
+ Collaboration diagram for Wikibase\Repo\RestApi\Infrastructure\ItemDeserializerItemValidator:

Public Member Functions

 __construct (ItemDeserializer $deserializer, LanguageCodeValidator $languageCodeValidator, TermValidatorFactoryLabelTextValidator $labelTextValidator, TermsCollisionDetector $termsCollisionDetector)
 
 validate (array $itemSerialization)
 
 getValidatedItem ()
 

Private Member Functions

 validateItemLabels (TermList $labels)
 
 checkTermsEqualityAndDuplication (Term $label)
 
 validateLanguageCode (string $languageCode, string $field)
 

Private Attributes

Item $deserializedItem = null
 
ItemDeserializer $deserializer
 
LanguageCodeValidator $languageCodeValidator
 
TermValidatorFactoryLabelTextValidator $labelTextValidator
 
TermsCollisionDetector $termsCollisionDetector
 

Additional Inherited Members

- Public Attributes inherited from Wikibase\Repo\RestApi\Application\Validation\ItemValidator
const CODE_INVALID_FIELD = 'invalid-item-field'
 
const CODE_UNEXPECTED_FIELD = 'item-data-unexpected-field'
 
const CODE_MISSING_LABELS_AND_DESCRIPTIONS = 'missing-labels-and-descriptions'
 
const CODE_EMPTY_LABEL = 'label-empty'
 
const CODE_INVALID_LABEL = 'invalid-label'
 
const CODE_INVALID_LANGUAGE_CODE = 'invalid-language-code'
 
const CODE_LABEL_DESCRIPTION_SAME_VALUE = 'label-description-same-value'
 
const CODE_LABEL_DESCRIPTION_DUPLICATE = 'item-label-description-duplicate'
 
const CONTEXT_FIELD_NAME = 'field'
 
const CONTEXT_FIELD_VALUE = 'value'
 
const CONTEXT_FIELD_LABEL = 'label'
 
const CONTEXT_FIELD_DESCRIPTION = 'description'
 
const CONTEXT_FIELD_LANGUAGE = 'language'
 
const CONTEXT_MATCHING_ITEM_ID = 'matching-item-id'
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Repo\RestApi\Infrastructure\ItemDeserializerItemValidator::__construct ( ItemDeserializer $deserializer,
LanguageCodeValidator $languageCodeValidator,
TermValidatorFactoryLabelTextValidator $labelTextValidator,
TermsCollisionDetector $termsCollisionDetector )

Member Function Documentation

◆ checkTermsEqualityAndDuplication()

Wikibase\Repo\RestApi\Infrastructure\ItemDeserializerItemValidator::checkTermsEqualityAndDuplication ( Term $label)
private

◆ getValidatedItem()

Wikibase\Repo\RestApi\Infrastructure\ItemDeserializerItemValidator::getValidatedItem ( )

◆ validate()

Wikibase\Repo\RestApi\Infrastructure\ItemDeserializerItemValidator::validate ( array $itemSerialization)

◆ validateItemLabels()

Wikibase\Repo\RestApi\Infrastructure\ItemDeserializerItemValidator::validateItemLabels ( TermList $labels)
private

◆ validateLanguageCode()

Wikibase\Repo\RestApi\Infrastructure\ItemDeserializerItemValidator::validateLanguageCode ( string $languageCode,
string $field )
private

Member Data Documentation

◆ $deserializedItem

Item Wikibase\Repo\RestApi\Infrastructure\ItemDeserializerItemValidator::$deserializedItem = null
private

◆ $deserializer

ItemDeserializer Wikibase\Repo\RestApi\Infrastructure\ItemDeserializerItemValidator::$deserializer
private

◆ $labelTextValidator

TermValidatorFactoryLabelTextValidator Wikibase\Repo\RestApi\Infrastructure\ItemDeserializerItemValidator::$labelTextValidator
private

◆ $languageCodeValidator

LanguageCodeValidator Wikibase\Repo\RestApi\Infrastructure\ItemDeserializerItemValidator::$languageCodeValidator
private

◆ $termsCollisionDetector

TermsCollisionDetector Wikibase\Repo\RestApi\Infrastructure\ItemDeserializerItemValidator::$termsCollisionDetector
private

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