Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Wikibase\DataModel\Services\Lookup\EntityLookup Interface Reference

Service interface for retrieving Entities from storage. More...

+ Inheritance diagram for Wikibase\DataModel\Services\Lookup\EntityLookup:

Public Member Functions

 getEntity (EntityId $entityId)
 
 hasEntity (EntityId $entityId)
 Returns whether the given entity can bee looked up using getEntity().
 

Detailed Description

Service interface for retrieving Entities from storage.

Since
1.1
Author
Jeroen De Dauw < jeroe.nosp@m.nded.nosp@m.auw@g.nosp@m.mail.nosp@m..com >
Daniel Kinzler

Member Function Documentation

◆ getEntity()

Wikibase\DataModel\Services\Lookup\EntityLookup::getEntity ( EntityId $entityId)
Note
Implementations of this method may or may not resolve redirects. Code that needs control over redirect resolution should use an EntityRevisionLookup instead.
Since
2.0
Parameters
EntityId$entityId
Returns
EntityDocument|null
Exceptions
EntityLookupException

Implemented in Wikibase\Lib\Store\RevisionBasedEntityLookup, Wikibase\DataModel\Services\Lookup\DisabledEntityTypesEntityLookup, Wikibase\DataModel\Services\Lookup\ExceptionIgnoringEntityLookup, Wikibase\DataModel\Services\Lookup\InMemoryEntityLookup, Wikibase\DataModel\Services\Lookup\RedirectResolvingEntityLookup, and Wikibase\DataModel\Services\Lookup\RestrictedEntityLookup.

◆ hasEntity()

Wikibase\DataModel\Services\Lookup\EntityLookup::hasEntity ( EntityId $entityId)

Returns whether the given entity can bee looked up using getEntity().

This avoids loading and deserializing entity content just to check whether the entity exists.

Note
Implementations of this method may or may not resolve redirects. Code that needs control over redirect resolution should use an EntityRevisionLookup instead.
Since
1.1
Parameters
EntityId$entityId
Returns
bool
Exceptions
EntityLookupException

Implemented in Wikibase\Lib\Store\RevisionBasedEntityLookup, Wikibase\DataModel\Services\Lookup\DisabledEntityTypesEntityLookup, Wikibase\DataModel\Services\Lookup\ExceptionIgnoringEntityLookup, Wikibase\DataModel\Services\Lookup\InMemoryEntityLookup, Wikibase\DataModel\Services\Lookup\RedirectResolvingEntityLookup, and Wikibase\DataModel\Services\Lookup\RestrictedEntityLookup.


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