Wikibase
MediaWiki Wikibase extension
Wikibase\DataModel\Services\Lookup\ExceptionIgnoringEntityLookup Class Reference

An EntityLookup which ignores any exceptions which occur while retrieving an entity and instead pretends the entity does not exist. More...

+ Inheritance diagram for Wikibase\DataModel\Services\Lookup\ExceptionIgnoringEntityLookup:
+ Collaboration diagram for Wikibase\DataModel\Services\Lookup\ExceptionIgnoringEntityLookup:

Public Member Functions

 __construct (EntityLookup $lookup)
 
 getEntity (EntityId $entityId)
 Attempt to retrieve the entity, returning null if any errors occur. More...
 
 hasEntity (EntityId $entityId)
 Returns whether the given entity can potentially be looked up using getEntity(). More...
 

Private Attributes

 $lookup
 

Detailed Description

An EntityLookup which ignores any exceptions which occur while retrieving an entity and instead pretends the entity does not exist.

Constructor & Destructor Documentation

◆ __construct()

Wikibase\DataModel\Services\Lookup\ExceptionIgnoringEntityLookup::__construct ( EntityLookup  $lookup)

Member Function Documentation

◆ getEntity()

Wikibase\DataModel\Services\Lookup\ExceptionIgnoringEntityLookup::getEntity ( EntityId  $entityId)

Attempt to retrieve the entity, returning null if any errors occur.

Parameters
EntityId$entityId
Returns
EntityDocument|null

Implements Wikibase\DataModel\Services\Lookup\EntityLookup.

◆ hasEntity()

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

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

Note that this does not guarantee getEntity() will return an EntityDocument – it may still return null if an error occurs retrieving the entity.

Parameters
EntityId$entityId
Returns
bool

Implements Wikibase\DataModel\Services\Lookup\EntityLookup.

Member Data Documentation

◆ $lookup

Wikibase\DataModel\Services\Lookup\ExceptionIgnoringEntityLookup::$lookup
private

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