Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Wikibase\DataModel\Services\Lookup\RedirectResolvingEntityLookup Class Reference

Implementation of EntityLookup that opaquely resolves one level of redirects when looking up entities. More...

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

Public Member Functions

 __construct (EntityLookup $lookup)
 
 getEntity (EntityId $entityId)
 
 hasEntity (EntityId $entityId)
 

Private Attributes

 $lookup
 

Detailed Description

Implementation of EntityLookup that opaquely resolves one level of redirects when looking up entities.

Since
2.0
Author
Daniel Kinzler

Constructor & Destructor Documentation

◆ __construct()

Wikibase\DataModel\Services\Lookup\RedirectResolvingEntityLookup::__construct ( EntityLookup $lookup)
Parameters
EntityLookup$lookupThe lookup to use

Member Function Documentation

◆ getEntity()

Wikibase\DataModel\Services\Lookup\RedirectResolvingEntityLookup::getEntity ( EntityId $entityId)
See also
EntityLookup::getEntity

If the given entity ID points to a redirect, that redirect is resolved and the target entity returned.

Callers can detect the presence of a redirect by comparing the ID of the returned Entity with the request ID.

Parameters
EntityId$entityId
Returns
EntityDocument|null
Exceptions
EntityLookupException

Implements Wikibase\DataModel\Services\Lookup\EntityLookup.

◆ hasEntity()

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

If the given entity ID points to a redirect, that redirect is resolved and the existence of the target entity is checked.

Parameters
EntityId$entityId
Returns
bool
Exceptions
EntityLookupException

Implements Wikibase\DataModel\Services\Lookup\EntityLookup.

Member Data Documentation

◆ $lookup

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

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