WikibaseLexeme
MediaWiki WikibaseLexeme extension
Loading...
Searching...
No Matches
Wikibase\Lexeme\DataAccess\ChangeOp\Validation\LexemeTermSerializationValidator Class Reference

Public Member Functions

 __construct (LexemeTermLanguageValidator $languageValidator)
 
 validateStructure ( $serialization, ValidationContext $context)
 Validate the structure of the given $serialization.
 
 validateLanguage ( $language, array $serialization, ValidationContext $context)
 Check that the language inside the $serialization is valid and consistent with the given $language.
 

Private Attributes

 $languageValidator
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Lexeme\DataAccess\ChangeOp\Validation\LexemeTermSerializationValidator::__construct ( LexemeTermLanguageValidator $languageValidator)

Member Function Documentation

◆ validateLanguage()

Wikibase\Lexeme\DataAccess\ChangeOp\Validation\LexemeTermSerializationValidator::validateLanguage ( $language,
array $serialization,
ValidationContext $context )

Check that the language inside the $serialization is valid and consistent with the given $language.

The $serialization must already have been validated for structural correctness.

Parameters
string$language(checking that it is a string is part of the validation)

◆ validateStructure()

Wikibase\Lexeme\DataAccess\ChangeOp\Validation\LexemeTermSerializationValidator::validateStructure ( $serialization,
ValidationContext $context )

Validate the structure of the given $serialization.

If the term is not being removed, callers should also call LexemeTermSerializationValidator::validateLanguage() afterwards.

Parameters
array$serialization(checking that it is an array is part of the validation)
ValidationContext$context

Member Data Documentation

◆ $languageValidator

Wikibase\Lexeme\DataAccess\ChangeOp\Validation\LexemeTermSerializationValidator::$languageValidator
private

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