Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Wikibase\Lib\Normalization\SnakNormalizer Class Reference

Public Member Functions

 __construct (PropertyDataTypeLookup $dataTypeLookup, LoggerInterface $logger, array $normalizerDefinitions)
 
 normalize (Snak $snak)
 

Private Member Functions

 getNormalizer (PropertyId $propertyId, string $valueType)
 
 makeNormalizer (PropertyId $propertyId, string $valueType)
 

Private Attributes

 $dataTypeLookup
 
 $logger
 
 $normalizerDefinitions
 
 $normalizers = []
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Lib\Normalization\SnakNormalizer::__construct ( PropertyDataTypeLookup $dataTypeLookup,
LoggerInterface $logger,
array $normalizerDefinitions )
Parameters
PropertyDataTypeLookup$dataTypeLookupUsed to look up property data types for the given snaks. If the data type cannot be looked up, an info message is logged and the snak value is only normalized according to its data value type.
LoggerInterface$loggerFor logging that info message.
callable[]$normalizerDefinitionsA mapping from data and value types (PT:xxx and VT:xxx) to callables which return either a single DataValueNormalizer or a list of them.

Member Function Documentation

◆ getNormalizer()

Wikibase\Lib\Normalization\SnakNormalizer::getNormalizer ( PropertyId $propertyId,
string $valueType )
private

◆ makeNormalizer()

Wikibase\Lib\Normalization\SnakNormalizer::makeNormalizer ( PropertyId $propertyId,
string $valueType )
private

◆ normalize()

Wikibase\Lib\Normalization\SnakNormalizer::normalize ( Snak $snak)

Member Data Documentation

◆ $dataTypeLookup

Wikibase\Lib\Normalization\SnakNormalizer::$dataTypeLookup
private

◆ $logger

Wikibase\Lib\Normalization\SnakNormalizer::$logger
private

◆ $normalizerDefinitions

Wikibase\Lib\Normalization\SnakNormalizer::$normalizerDefinitions
private

◆ $normalizers

Wikibase\Lib\Normalization\SnakNormalizer::$normalizers = []
private

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