Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Wikibase\DataModel\Entity\DispatchingEntityIdParser Class Reference
+ Inheritance diagram for Wikibase\DataModel\Entity\DispatchingEntityIdParser:
+ Collaboration diagram for Wikibase\DataModel\Entity\DispatchingEntityIdParser:

Public Member Functions

 __construct (array $idBuilders)
 Takes an array in which each key is a preg_match pattern.
 
 parse ( $idSerialization)
 

Private Member Functions

 assertIdIsString ( $idSerialization)
 
 buildId ( $idBuilder, $idSerialization)
 

Private Attributes

 $idBuilders
 

Detailed Description

Since
4.2
Author
Jeroen De Dauw < jeroe.nosp@m.nded.nosp@m.auw@g.nosp@m.mail.nosp@m..com >

Constructor & Destructor Documentation

◆ __construct()

Wikibase\DataModel\Entity\DispatchingEntityIdParser::__construct ( array $idBuilders)

Takes an array in which each key is a preg_match pattern.

The first pattern the id matches against will be picked. The value this key points to has to be a builder function that takes as only required argument the id serialization (string) and returns an EntityId instance.

Parameters
callable[]$idBuilders

Member Function Documentation

◆ assertIdIsString()

Wikibase\DataModel\Entity\DispatchingEntityIdParser::assertIdIsString ( $idSerialization)
private
Parameters
string$idSerialization
Exceptions
EntityIdParsingException

◆ buildId()

Wikibase\DataModel\Entity\DispatchingEntityIdParser::buildId ( $idBuilder,
$idSerialization )
private
Parameters
callable$idBuilder
string$idSerialization
Exceptions
EntityIdParsingException
Returns
EntityId

◆ parse()

Wikibase\DataModel\Entity\DispatchingEntityIdParser::parse ( $idSerialization)
Parameters
string$idSerialization
Exceptions
EntityIdParsingException
Returns
EntityId

Implements Wikibase\DataModel\Entity\EntityIdParser.

Member Data Documentation

◆ $idBuilders

Wikibase\DataModel\Entity\DispatchingEntityIdParser::$idBuilders
private

The documentation for this class was generated from the following file: