Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
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, $moduleName, OutputFormatValueFormatterFactory $valueFormatterFactory, OutputFormatSnakFormatterFactory $snakFormatterFactory, DataValueFactory $dataValueFactory, ApiErrorReporter $apiErrorReporter)
 
 execute ()
 

Protected Member Functions

 getAllowedParams ()
 
 getExamplesMessages ()
 

Private Member Functions

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

Private Attributes

 $valueFormatterFactory
 
 $snakFormatterFactory
 
 $dataValueFactory
 
 $errorReporter
 

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,
  $moduleName,
OutputFormatValueFormatterFactory  $valueFormatterFactory,
OutputFormatSnakFormatterFactory  $snakFormatterFactory,
DataValueFactory  $dataValueFactory,
ApiErrorReporter  $apiErrorReporter 
)
See also
ApiBase::__construct
Parameters
ApiMain$mainModule
string$moduleName
OutputFormatValueFormatterFactory$valueFormatterFactory
OutputFormatSnakFormatterFactory$snakFormatterFactory
DataValueFactory$dataValueFactory
ApiErrorReporter$apiErrorReporter

Member Function Documentation

◆ decodeDataValue()

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

◆ decodeSnak()

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

◆ execute()

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

◆ formatValue()

Wikibase\Repo\Api\FormatSnakValue::formatValue (   $params,
  $value,
  $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 (   $optionsParam)
private
Parameters
string | null$optionsParam
Returns
FormatterOptions

◆ getSnakFormatter()

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

◆ getValueFormatter()

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

Member Data Documentation

◆ $dataValueFactory

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

◆ $errorReporter

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

◆ $snakFormatterFactory

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

◆ $valueFormatterFactory

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

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