EntityIdParser that maps a prefix of id serialization to a local prefix according to the prefix mapping, or adds a fixed prefix to the id serialization not containing a mapped prefix, and parses resulting string as an EntityId.
More...
|
| __construct (array $prefixMapping, EntityIdParser $idParser) |
|
| parse ( $idSerialization) |
| Maps prefix(es) of the id serialization according to the prefix mapping definition, or adds a fixed prefix to the id serialization if there is no relevant prefix mapping, Resulting id serialization is parsed as an EntityId. More...
|
|
EntityIdParser that maps a prefix of id serialization to a local prefix according to the prefix mapping, or adds a fixed prefix to the id serialization not containing a mapped prefix, and parses resulting string as an EntityId.
This can be used to prefix IDs of entities coming from a foreign repository with the repository name to avoid clashes with IDs of local entities.
- See also
- docs/foreign-entity-ids.wiki in the DataModel module
- Since
- 3.7
- Copyright
- GPL-2.0-or-later
◆ __construct()
Wikibase\DataModel\Services\EntityId\PrefixMappingEntityIdParser::__construct |
( |
array |
$prefixMapping, |
|
|
EntityIdParser |
$idParser |
|
) |
| |
- Since
- 3.7
- Parameters
-
string[] | $prefixMapping | Must contain an empty-string key defining prefix added to id serializations that do not contain any of prefixed defined in $prefixMapping. Values should not contain colons, in particular at the end of the string |
EntityIdParser | $idParser | |
- Exceptions
-
ParameterAssertionException | |
◆ parse()
Wikibase\DataModel\Services\EntityId\PrefixMappingEntityIdParser::parse |
( |
|
$idSerialization | ) |
|
Maps prefix(es) of the id serialization according to the prefix mapping definition, or adds a fixed prefix to the id serialization if there is no relevant prefix mapping, Resulting id serialization is parsed as an EntityId.
- Since
- 3.7
- See also
- docs/foreign-entity-ids.wiki in the DataModel module
- Parameters
-
- Returns
- EntityId
- Exceptions
-
Implements Wikibase\DataModel\Entity\EntityIdParser.
◆ $idParser
Wikibase\DataModel\Services\EntityId\PrefixMappingEntityIdParser::$idParser |
|
private |
◆ $prefixMapping
Wikibase\DataModel\Services\EntityId\PrefixMappingEntityIdParser::$prefixMapping |
|
private |
The documentation for this class was generated from the following file: