|
Wikibase
MediaWiki Wikibase extension
|
EntityIdParser that strips a fixed prefix and parses the remaining suffix as an EntityId. More...
Inheritance diagram for Wikibase\DataModel\Services\EntityId\SuffixEntityIdParser:
Collaboration diagram for Wikibase\DataModel\Services\EntityId\SuffixEntityIdParser:Public Member Functions | |
| __construct (string $prefix, EntityIdParser $idParser) | |
| parse (string $idSerialization) | |
| Parses the given string into an EntityId by first stripping a fixed prefix. | |
Private Attributes | |
| $prefix | |
| $idParser | |
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.
| Wikibase\DataModel\Services\EntityId\SuffixEntityIdParser::__construct | ( | string | $prefix, |
| EntityIdParser | $idParser ) |
| string | $prefix | The prefix to be stripped. Stripping is case sensitive. |
| EntityIdParser | $idParser |
| Wikibase\DataModel\Services\EntityId\SuffixEntityIdParser::parse | ( | string | $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.
| string | $idSerialization | An entity ID with some prefix attached, e.g. an entity URI. |
| EntityIdParsingException | If the string does not start with the expected prefix, or the remaining suffix is not a valid entity ID string. |
Implements Wikibase\DataModel\Entity\EntityIdParser.
|
private |
|
private |