Wikibase
MediaWiki Wikibase extension
|
A holder for entity objects. More...
Public Member Functions | |
getEntity ( $expectedClass=EntityDocument::class) | |
Returns the entity held by this EntityHolder. More... | |
getEntityId () | |
Returns the ID of the entity held by this EntityHolder. More... | |
getEntityType () | |
Returns the type of the entity held by this EntityHolder. More... | |
A holder for entity objects.
Wikibase\Repo\Content\EntityHolder::getEntity | ( | $expectedClass = EntityDocument::class | ) |
Returns the entity held by this EntityHolder.
Depending on the implementation, this operation may be expensive or trivial.
string | $expectedClass | The class with which the result is expected to be compatible. Defaults to EntityDocument. |
RuntimeException | If the entity held by this EntityHolder is not compatible with $expectedClass. |
Implemented in Wikibase\Repo\Content\EntityInstanceHolder, Wikibase\Repo\Content\DeferredDecodingEntityHolder, and Wikibase\Repo\Content\DeferredCopyEntityHolder.
Wikibase\Repo\Content\EntityHolder::getEntityId | ( | ) |
Returns the ID of the entity held by this EntityHolder.
May or may not require the actual entity to be instantiated. May be null if the entity does not have an ID set.
Implemented in Wikibase\Repo\Content\EntityInstanceHolder, Wikibase\Repo\Content\DeferredDecodingEntityHolder, and Wikibase\Repo\Content\DeferredCopyEntityHolder.
Wikibase\Repo\Content\EntityHolder::getEntityType | ( | ) |
Returns the type of the entity held by this EntityHolder.
May or may not require the actual entity or the entity's ID to be instantiated. Implementations must make sure that this is never null.
Implemented in Wikibase\Repo\Content\EntityInstanceHolder, Wikibase\Repo\Content\DeferredDecodingEntityHolder, and Wikibase\Repo\Content\DeferredCopyEntityHolder.