Wikibase
MediaWiki Wikibase extension
|
EntityIdParser that strips a fixed prefix and parses the remaining suffix as an EntityId. More...
Public Member Functions | |
__construct ( $prefix, EntityIdParser $idParser) | |
parse ( $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 | ( | $prefix, | |
EntityIdParser | $idParser ) |
string | $prefix | The prefix to be stripped. Stripping is case sensitive. |
EntityIdParser | $idParser |
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.
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 |