Wikibase
MediaWiki Wikibase extension
Wikibase\Repo\Api\FormatSnakValue Class Reference

API module for using value formatters. More...

+ Inheritance diagram for Wikibase\Repo\Api\FormatSnakValue:
+ Collaboration diagram for Wikibase\Repo\Api\FormatSnakValue:

Public Member Functions

 __construct (ApiMain $mainModule, string $moduleName, OutputFormatValueFormatterFactory $valueFormatterFactory, OutputFormatSnakFormatterFactory $snakFormatterFactory, DataTypeFactory $dataTypeFactory, DataValueFactory $dataValueFactory, ApiErrorReporter $apiErrorReporter, ?IBufferingStatsdDataFactory $stats, EntityIdParser $entityIdParser)
 
 execute ()
 

Static Public Member Functions

static factory (ApiMain $mainModule, string $moduleName, IBufferingStatsdDataFactory $stats, ApiHelperFactory $apiHelperFactory, DataTypeFactory $dataTypeFactory, DataValueFactory $dataValueFactory, EntityIdParser $entityIdParser, OutputFormatSnakFormatterFactory $snakFormatterFactory, OutputFormatValueFormatterFactory $valueFormatterFactory)
 

Protected Member Functions

 getAllowedParams ()
 
 getExamplesMessages ()
 

Private Member Functions

 formatValue (array $params, DataValue $value, ?string $dataTypeId)
 
 getValueFormatter (array $params)
 
 getSnakFormatter (array $params)
 
 decodeSnak (string $propertyIdSerialization, DataValue $dataValue)
 
 decodeDataValue (string $json)
 
 getOptionsObject (?string $optionsParam)
 
 getDataTypeId (array $params)
 Returns the data type ID specified by the parameters. More...
 

Private Attributes

 $valueFormatterFactory
 
 $snakFormatterFactory
 
 $dataTypeFactory
 
 $dataValueFactory
 
 $errorReporter
 
 $stats
 
 $entityIdParser
 

Detailed Description

API module for using value formatters.

Author
Daniel Kinzler
Addshore
Marius Hoch

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Repo\Api\FormatSnakValue::__construct ( ApiMain  $mainModule,
string  $moduleName,
OutputFormatValueFormatterFactory  $valueFormatterFactory,
OutputFormatSnakFormatterFactory  $snakFormatterFactory,
DataTypeFactory  $dataTypeFactory,
DataValueFactory  $dataValueFactory,
ApiErrorReporter  $apiErrorReporter,
?IBufferingStatsdDataFactory  $stats,
EntityIdParser  $entityIdParser 
)
See also
ApiBase::__construct
Parameters
ApiMain$mainModule
string$moduleName
OutputFormatValueFormatterFactory$valueFormatterFactory
OutputFormatSnakFormatterFactory$snakFormatterFactory
DataTypeFactory$dataTypeFactory
DataValueFactory$dataValueFactory
ApiErrorReporter$apiErrorReporter
IBufferingStatsdDataFactory | null$stats
EntityIdParser$entityIdParser

Member Function Documentation

◆ decodeDataValue()

Wikibase\Repo\Api\FormatSnakValue::decodeDataValue ( string  $json)
private
Parameters
string$jsonA JSON-encoded DataValue
Exceptions
ApiUsageException
LogicException
Returns
DataValue

◆ decodeSnak()

Wikibase\Repo\Api\FormatSnakValue::decodeSnak ( string  $propertyIdSerialization,
DataValue  $dataValue 
)
private

◆ execute()

Wikibase\Repo\Api\FormatSnakValue::execute ( )

◆ factory()

static Wikibase\Repo\Api\FormatSnakValue::factory ( ApiMain  $mainModule,
string  $moduleName,
IBufferingStatsdDataFactory  $stats,
ApiHelperFactory  $apiHelperFactory,
DataTypeFactory  $dataTypeFactory,
DataValueFactory  $dataValueFactory,
EntityIdParser  $entityIdParser,
OutputFormatSnakFormatterFactory  $snakFormatterFactory,
OutputFormatValueFormatterFactory  $valueFormatterFactory 
)
static

◆ formatValue()

Wikibase\Repo\Api\FormatSnakValue::formatValue ( array  $params,
DataValue  $value,
?string  $dataTypeId 
)
private

◆ getAllowedParams()

Wikibase\Repo\Api\FormatSnakValue::getAllowedParams ( )
protected

◆ getDataTypeId()

Wikibase\Repo\Api\FormatSnakValue::getDataTypeId ( array  $params)
private

Returns the data type ID specified by the parameters.

Parameters
array$params
Returns
string|null

◆ getExamplesMessages()

Wikibase\Repo\Api\FormatSnakValue::getExamplesMessages ( )
protected

◆ getOptionsObject()

Wikibase\Repo\Api\FormatSnakValue::getOptionsObject ( ?string  $optionsParam)
private

◆ getSnakFormatter()

Wikibase\Repo\Api\FormatSnakValue::getSnakFormatter ( array  $params)
private
Exceptions
LogicException
Returns
SnakFormatter

◆ getValueFormatter()

Wikibase\Repo\Api\FormatSnakValue::getValueFormatter ( array  $params)
private
Exceptions
LogicException
Returns
ValueFormatter

Member Data Documentation

◆ $dataTypeFactory

Wikibase\Repo\Api\FormatSnakValue::$dataTypeFactory
private

◆ $dataValueFactory

Wikibase\Repo\Api\FormatSnakValue::$dataValueFactory
private

◆ $entityIdParser

Wikibase\Repo\Api\FormatSnakValue::$entityIdParser
private

◆ $errorReporter

Wikibase\Repo\Api\FormatSnakValue::$errorReporter
private

◆ $snakFormatterFactory

Wikibase\Repo\Api\FormatSnakValue::$snakFormatterFactory
private

◆ $stats

Wikibase\Repo\Api\FormatSnakValue::$stats
private

◆ $valueFormatterFactory

Wikibase\Repo\Api\FormatSnakValue::$valueFormatterFactory
private

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