|
const | PATTERN = '/^:?(\w+:)*[^:]+\z/' |
|
- Since
- 0.5 Abstract since 2.0
- Copyright
- GPL-2.0-or-later
◆ __construct()
Wikibase\DataModel\Entity\EntityId::__construct |
( |
|
$serialization | ) |
|
◆ __toString()
Wikibase\DataModel\Entity\EntityId::__toString |
( |
| ) |
|
This is a human readable representation of the EntityId.
This format is allowed to change and should therefore not be relied upon to be stable.
- Returns
- string
◆ assertValidSerialization()
static Wikibase\DataModel\Entity\EntityId::assertValidSerialization |
( |
|
$serialization | ) |
|
|
staticprivate |
◆ equals()
Wikibase\DataModel\Entity\EntityId::equals |
( |
|
$target | ) |
|
- Since
- 0.5
- Parameters
-
- Returns
- bool
◆ extractRepositoryNameAndLocalPart()
static Wikibase\DataModel\Entity\EntityId::extractRepositoryNameAndLocalPart |
( |
|
$serialization | ) |
|
|
staticprotected |
Returns a pair (repository name, local part of ID) from the given ID serialization.
Note: this does not perform any validation of the given input. Calling code should take care of this!
- Since
- 7.3
- Parameters
-
- Returns
- string[] Array of form [ string $repositoryName, string $localPart ]
◆ extractSerializationParts()
static Wikibase\DataModel\Entity\EntityId::extractSerializationParts |
( |
|
$serialization | ) |
|
|
staticprivate |
Splits the given ID serialization into an array with the following three elements:
- the repository name as the first element (empty string for local repository)
- any parts of the ID serialization but the repository name and the local ID (if any, empty string if nothing else present)
- the local ID Note: this method does not perform any validation of the given input. Calling code should take care of this!
- Parameters
-
- Returns
- string[]
◆ getEntityType()
Wikibase\DataModel\Entity\EntityId::getEntityType |
( |
| ) |
|
|
abstract |
◆ getLocalPart()
Wikibase\DataModel\Entity\EntityId::getLocalPart |
( |
| ) |
|
Returns the serialization without the first repository prefix.
- Since
- 6.2
- Returns
- string
◆ getRepositoryName()
Wikibase\DataModel\Entity\EntityId::getRepositoryName |
( |
| ) |
|
Returns '' for local IDs and the foreign repository name for foreign IDs.
For chained IDs (e.g. foo:bar:Q42) it will return only the first part.
- Since
- 6.2
- Returns
- string
◆ getSerialization()
Wikibase\DataModel\Entity\EntityId::getSerialization |
( |
| ) |
|
◆ isForeign()
Wikibase\DataModel\Entity\EntityId::isForeign |
( |
| ) |
|
◆ joinSerialization()
static Wikibase\DataModel\Entity\EntityId::joinSerialization |
( |
array |
$parts | ) |
|
|
static |
◆ normalizeIdSerialization()
static Wikibase\DataModel\Entity\EntityId::normalizeIdSerialization |
( |
|
$id | ) |
|
|
staticprivate |
◆ splitSerialization()
static Wikibase\DataModel\Entity\EntityId::splitSerialization |
( |
|
$serialization | ) |
|
|
static |
Returns an array with 3 elements: the foreign repository name as the first element, the local ID as the last element and everything that is in between as the second element.
EntityId::joinSerialization can be used to restore the original serialization from the parts returned.
- Since
- 6.2
- Parameters
-
- Exceptions
-
- Returns
- string[] Array containing the serialization split into 3 parts.
◆ $localPart
Wikibase\DataModel\Entity\EntityId::$localPart |
|
protected |
◆ $repositoryName
Wikibase\DataModel\Entity\EntityId::$repositoryName |
|
protected |
◆ $serialization
Wikibase\DataModel\Entity\EntityId::$serialization |
|
protected |
◆ PATTERN
const Wikibase\DataModel\Entity\EntityId::PATTERN = '/^:?(\w+:)*[^:]+\z/' |
The documentation for this class was generated from the following file: