Wikibase
MediaWiki Wikibase extension
|
EntityHolder implementing deferred copying. More...
Public Member Functions | |
__construct (EntityHolder $entityHolder) | |
getEntity ( $expectedClass=EntityDocument::class) | |
getEntityId () | |
getEntityType () | |
Private Attributes | |
$entityHolder | |
$entity = null | |
EntityHolder implementing deferred copying.
Wikibase\Repo\Content\DeferredCopyEntityHolder::__construct | ( | EntityHolder | $entityHolder | ) |
Wikibase\Repo\Content\DeferredCopyEntityHolder::getEntity | ( | $expectedClass = EntityDocument::class | ) |
This implements lazy initialization of the entity: when called for the first time, this method will call getEntity() on the EntityHolder passed to the constructor, and then deep clone the entity returned. The resulting copy is returned. Subsequent calls will return the same entity.
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. |
Implements Wikibase\Repo\Content\EntityHolder.
Wikibase\Repo\Content\DeferredCopyEntityHolder::getEntityId | ( | ) |
Implements Wikibase\Repo\Content\EntityHolder.
Wikibase\Repo\Content\DeferredCopyEntityHolder::getEntityType | ( | ) |
|
private |
|
private |