Service for getting information about supported data formats.
More...
|
| initFormats () |
| Initializes the internal mapping of MIME types and file extensions to format names.
|
|
| newApiMain ( $format) |
| Returns an ApiMain module that acts as a context for the formatting and serialization.
|
|
|
static | getApiFormatName ( $format) |
| Normalizes the format specifier; Converts mime types to API format names.
|
|
static | getApiMimeTypes ( $format) |
| Converts API format names to MIME types.
|
|
Service for getting information about supported data formats.
- Copyright
- GPL-2.0-or-later
◆ __construct()
Wikibase\Repo\LinkedData\EntityDataFormatProvider::__construct |
( |
| ) |
|
◆ getAllowedFormats()
Wikibase\Repo\LinkedData\EntityDataFormatProvider::getAllowedFormats |
( |
| ) |
|
◆ getApiFormatName()
static Wikibase\Repo\LinkedData\EntityDataFormatProvider::getApiFormatName |
( |
| $format | ) |
|
|
staticprivate |
Normalizes the format specifier; Converts mime types to API format names.
- Parameters
-
string | $format | The format as supplied in the request |
- Returns
- string|null The normalized format name, or null if the format is unknown
◆ getApiMimeTypes()
static Wikibase\Repo\LinkedData\EntityDataFormatProvider::getApiMimeTypes |
( |
| $format | ) |
|
|
staticprivate |
Converts API format names to MIME types.
- Parameters
-
string | $format | The API format name |
- Returns
- string[]|null The MIME types for the given format
◆ getExtension()
Wikibase\Repo\LinkedData\EntityDataFormatProvider::getExtension |
( |
| $format | ) |
|
Returns a file extension suitable for $format, or null if no such extension is known.
- Parameters
-
string | $format | A canonical format name, as returned by getFormatName() or getSupportedFormats(). |
- Returns
- string|null
◆ getFormatName()
Wikibase\Repo\LinkedData\EntityDataFormatProvider::getFormatName |
( |
| $format | ) |
|
Returns a canonical format name.
Used to normalize the format identifier.
- Parameters
-
string | $format | the format as a file extension or MIME type. |
- Returns
- string|null the canonical format name, or null of the format is not supported
◆ getMimeType()
Wikibase\Repo\LinkedData\EntityDataFormatProvider::getMimeType |
( |
| $format | ) |
|
Returns a MIME type suitable for $format, or null if no such extension is known.
- Parameters
-
string | $format | A canonical format name, as returned by getFormatName() or getSupportedFormats(). |
- Returns
- string|null
◆ getSupportedExtensions()
Wikibase\Repo\LinkedData\EntityDataFormatProvider::getSupportedExtensions |
( |
| ) |
|
Returns the list of supported file extensions that can be used to specify a format.
- Returns
- string[]
◆ getSupportedFormats()
Wikibase\Repo\LinkedData\EntityDataFormatProvider::getSupportedFormats |
( |
| ) |
|
Returns the list of supported formats using their canonical names.
- Returns
- string[]
◆ getSupportedMimeTypes()
Wikibase\Repo\LinkedData\EntityDataFormatProvider::getSupportedMimeTypes |
( |
| ) |
|
Returns the list of supported MIME types that can be used to specify the output format.
- Returns
- string[]
◆ initFormats()
Wikibase\Repo\LinkedData\EntityDataFormatProvider::initFormats |
( |
| ) |
|
|
private |
Initializes the internal mapping of MIME types and file extensions to format names.
◆ isRdfFormat()
Wikibase\Repo\LinkedData\EntityDataFormatProvider::isRdfFormat |
( |
| $format | ) |
|
Does $format specify a name for RDF format?
- Parameters
-
- Returns
- bool
◆ newApiMain()
Wikibase\Repo\LinkedData\EntityDataFormatProvider::newApiMain |
( |
| $format | ) |
|
|
private |
Returns an ApiMain module that acts as a context for the formatting and serialization.
- Parameters
-
string | $format | The desired output format, as a format name that ApiBase understands. |
- Returns
- ApiMain
◆ setAllowedFormats()
Wikibase\Repo\LinkedData\EntityDataFormatProvider::setAllowedFormats |
( |
array | $allowedFormats = null | ) |
|
- Parameters
-
string[] | null | $allowedFormats | |
◆ $allowedFormats
Wikibase\Repo\LinkedData\EntityDataFormatProvider::$allowedFormats = null |
|
private |
◆ $fileExtensions
Wikibase\Repo\LinkedData\EntityDataFormatProvider::$fileExtensions = null |
|
private |
◆ $mimeTypes
Wikibase\Repo\LinkedData\EntityDataFormatProvider::$mimeTypes = null |
|
private |
◆ $rdfWriterFactory
Wikibase\Repo\LinkedData\EntityDataFormatProvider::$rdfWriterFactory |
|
private |
The documentation for this class was generated from the following file: