EntityHolder implementing deferred copying.
More...
EntityHolder implementing deferred copying.
- Copyright
- GPL-2.0-or-later
- Author
- Daniel Kinzler
◆ __construct()
Wikibase\Repo\Content\DeferredCopyEntityHolder::__construct |
( |
EntityHolder |
$entityHolder | ) |
|
◆ getEntity()
Wikibase\Repo\Content\DeferredCopyEntityHolder::getEntity |
( |
|
$expectedClass = EntityDocument::class | ) |
|
- See also
- EntityHolder::getEntityId
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.
- Parameters
-
string | $expectedClass | The class with which the result is expected to be compatible. Defaults to EntityDocument. |
- Exceptions
-
RuntimeException | If the entity held by this EntityHolder is not compatible with $expectedClass. |
- Returns
- EntityDocument
Implements Wikibase\Repo\Content\EntityHolder.
◆ getEntityId()
Wikibase\Repo\Content\DeferredCopyEntityHolder::getEntityId |
( |
| ) |
|
◆ getEntityType()
Wikibase\Repo\Content\DeferredCopyEntityHolder::getEntityType |
( |
| ) |
|
◆ $entity
Wikibase\Repo\Content\DeferredCopyEntityHolder::$entity = null |
|
private |
◆ $entityHolder
Wikibase\Repo\Content\DeferredCopyEntityHolder::$entityHolder |
|
private |
The documentation for this class was generated from the following file: