Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Wikibase\Repo\Content\EntityInstanceHolder Class Reference

Trivial EntityHolder holding an entity object. More...

+ Inheritance diagram for Wikibase\Repo\Content\EntityInstanceHolder:
+ Collaboration diagram for Wikibase\Repo\Content\EntityInstanceHolder:

Public Member Functions

 __construct (EntityDocument $entity)
 
 getEntity ( $expectedClass=EntityDocument::class)
 
 getEntityId ()
 
 getEntityType ()
 

Private Attributes

 $entity
 

Detailed Description

Trivial EntityHolder holding an entity object.

Author
Daniel Kinzler

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Repo\Content\EntityInstanceHolder::__construct ( EntityDocument $entity)

Member Function Documentation

◆ getEntity()

Wikibase\Repo\Content\EntityInstanceHolder::getEntity ( $expectedClass = EntityDocument::class)
See also
EntityHolder::getEntityId
Parameters
string$expectedClassThe class the result is expected to be compatible with. Defaults to EntityDocument.
Exceptions
RuntimeExceptionIf the entity held by this EntityHolder is not compatible with $expectedClass.
Returns
EntityDocument

Implements Wikibase\Repo\Content\EntityHolder.

◆ getEntityId()

Wikibase\Repo\Content\EntityInstanceHolder::getEntityId ( )
See also
EntityHolder::getEntityId
Returns
EntityId|null

Implements Wikibase\Repo\Content\EntityHolder.

◆ getEntityType()

Wikibase\Repo\Content\EntityInstanceHolder::getEntityType ( )
See also
EntityHolder::getEntityType
Returns
string

Implements Wikibase\Repo\Content\EntityHolder.

Member Data Documentation

◆ $entity

Wikibase\Repo\Content\EntityInstanceHolder::$entity
private

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