Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Wikibase\Repo\SnakFactory Class Reference

Factory for creating new snaks. More...

+ Collaboration diagram for Wikibase\Repo\SnakFactory:

Public Member Functions

 __construct (PropertyDataTypeLookup $dataTypeLookup, DataTypeFactory $dataTypeFactory, SnakValueDeserializer $snakValueDeserializer)
 
 newSnak (PropertyId $propertyId, string $snakType, $rawValue=null)
 Builds and returns a new snak from the provided property, snak type and optional snak value.
 

Private Member Functions

 deserializeValue (DataType $dataType, $rawValue)
 

Private Attributes

PropertyDataTypeLookup $dataTypeLookup
 
DataTypeFactory $dataTypeFactory
 
SnakValueDeserializer $snakValueDeserializer
 

Detailed Description

Factory for creating new snaks.

Author
Daniel Kinzler

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Repo\SnakFactory::__construct ( PropertyDataTypeLookup $dataTypeLookup,
DataTypeFactory $dataTypeFactory,
SnakValueDeserializer $snakValueDeserializer )

Member Function Documentation

◆ deserializeValue()

Wikibase\Repo\SnakFactory::deserializeValue ( DataType $dataType,
$rawValue )
private
Exceptions
InvalidArgumentException

◆ newSnak()

Wikibase\Repo\SnakFactory::newSnak ( PropertyId $propertyId,
string $snakType,
$rawValue = null )

Builds and returns a new snak from the provided property, snak type and optional snak value.

Exceptions
PropertyDataTypeLookupExceptionfrom getDataTypeIdForProperty
OutOfBoundsExceptionfrom getType
InvalidArgumentExceptionfrom newDataValue, newDataValue and newSnak

Member Data Documentation

◆ $dataTypeFactory

DataTypeFactory Wikibase\Repo\SnakFactory::$dataTypeFactory
private

◆ $dataTypeLookup

PropertyDataTypeLookup Wikibase\Repo\SnakFactory::$dataTypeLookup
private

◆ $snakValueDeserializer

SnakValueDeserializer Wikibase\Repo\SnakFactory::$snakValueDeserializer
private

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