EntityIdParser that strips a fixed prefix and parses the remaining suffix as an EntityId.
More...
EntityIdParser that strips a fixed prefix and parses the remaining suffix as an EntityId.
This can be used to parse entity URIs into EntityId objects.
- Since
- 1.1
- Copyright
- GPL-2.0-or-later
- Author
- Daniel Kinzler
◆ __construct()
Wikibase\DataModel\Services\EntityId\SuffixEntityIdParser::__construct |
( |
|
$prefix, |
|
|
EntityIdParser |
$idParser |
|
) |
| |
- Parameters
-
string | $prefix | The prefix to be stripped. Stripping is case sensitive. |
EntityIdParser | $idParser | |
◆ parse()
Wikibase\DataModel\Services\EntityId\SuffixEntityIdParser::parse |
( |
|
$idSerialization | ) |
|
Parses the given string into an EntityId by first stripping a fixed prefix.
If the string does not start with the expected prefix, an EntityIdParsingException is thrown.
- Parameters
-
string | $idSerialization | An entity ID with some prefix attached, e.g. an entity URI. |
- Exceptions
-
EntityIdParsingException | If the string does not start with the expected prefix, or the remaining suffix is not a valid entity ID string. |
- Returns
- EntityId
Implements Wikibase\DataModel\Entity\EntityIdParser.
◆ $idParser
Wikibase\DataModel\Services\EntityId\SuffixEntityIdParser::$idParser |
|
private |
◆ $prefix
Wikibase\DataModel\Services\EntityId\SuffixEntityIdParser::$prefix |
|
private |
The documentation for this class was generated from the following file: