Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Wikibase\Repo\Validators\SnakValidator Class Reference
+ Inheritance diagram for Wikibase\Repo\Validators\SnakValidator:
+ Collaboration diagram for Wikibase\Repo\Validators\SnakValidator:

Public Member Functions

 __construct (PropertyDataTypeLookup $propertyDataTypeLookup, DataTypeFactory $dataTypeFactory, DataTypeValidatorFactory $validatorFactory)
 
 validateStatementSnaks (Statement $statement)
 Validates the Statement's main snak, qualifiers, and references.
 
 validateReferences (ReferenceList $references)
 Validate a list of references.
 
 validateReference (Reference $reference)
 Validate a list of references.
 
 validate ( $snak)
 Validates a Snak.
 
 validateDataValue (DataValue $dataValue, $dataTypeId)
 Validates the given data value using the given data type.
 
 setOptions (array $options)
 

Private Attributes

 $dataTypeFactory
 
 $propertyDataTypeLookup
 
 $validatorFactory
 

Detailed Description

Author
Daniel Kinzler

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Repo\Validators\SnakValidator::__construct ( PropertyDataTypeLookup $propertyDataTypeLookup,
DataTypeFactory $dataTypeFactory,
DataTypeValidatorFactory $validatorFactory )

Member Function Documentation

◆ setOptions()

Wikibase\Repo\Validators\SnakValidator::setOptions ( array $options)
See also
ValueValidator::setOptions()
Parameters
array$options

◆ validate()

Wikibase\Repo\Validators\SnakValidator::validate ( $snak)

Validates a Snak.

For a PropertyValueSnak, this is done using the validators from the DataType that is associated with the Snak's property. Other Snak types are currently not validated.

See also
ValueValidator::validate()
Parameters
Snak$snakThe value to validate
Exceptions
InvalidArgumentException
Returns
Result

◆ validateDataValue()

Wikibase\Repo\Validators\SnakValidator::validateDataValue ( DataValue $dataValue,
$dataTypeId )

Validates the given data value using the given data type.

Parameters
DataValue$dataValue
string$dataTypeId
Returns
Result

◆ validateReference()

Wikibase\Repo\Validators\SnakValidator::validateReference ( Reference $reference)

Validate a list of references.

This is done by validating all snaks in all of the references.

Parameters
Reference$reference
Returns
Result

◆ validateReferences()

Wikibase\Repo\Validators\SnakValidator::validateReferences ( ReferenceList $references)

Validate a list of references.

This is done by validating all snaks in all of the references.

Parameters
ReferenceList$references
Returns
Result

◆ validateStatementSnaks()

Wikibase\Repo\Validators\SnakValidator::validateStatementSnaks ( Statement $statement)

Validates the Statement's main snak, qualifiers, and references.

Member Data Documentation

◆ $dataTypeFactory

Wikibase\Repo\Validators\SnakValidator::$dataTypeFactory
private

◆ $propertyDataTypeLookup

Wikibase\Repo\Validators\SnakValidator::$propertyDataTypeLookup
private

◆ $validatorFactory

Wikibase\Repo\Validators\SnakValidator::$validatorFactory
private

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