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

Delegates lookup to the repository-specific EntityLookup based on the name of the repository an EntityId belongs to. More...

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

Public Member Functions

 __construct (array $lookups)
 
 getEntity (EntityId $entityId)
 
 hasEntity (EntityId $entityId)
 

Private Member Functions

 getLookupForEntityId (EntityId $entityId)
 

Private Attributes

 $lookups
 

Detailed Description

Delegates lookup to the repository-specific EntityLookup based on the name of the repository an EntityId belongs to.

This class does not strip repository prefixes of incoming entity IDs.

Since
3.7

Constructor & Destructor Documentation

◆ __construct()

Wikibase\DataModel\Services\Lookup\DispatchingEntityLookup::__construct ( array  $lookups)
Since
3.7
Parameters
EntityLookup[]$lookupsassociative array with repository names (strings) as keys and EntityLookup objects as values.
Exceptions
ParameterAssertionException

Member Function Documentation

◆ getEntity()

Wikibase\DataModel\Services\Lookup\DispatchingEntityLookup::getEntity ( EntityId  $entityId)
See also
EntityLookup::getEntity
Since
3.7
Parameters
EntityId$entityId
Returns
null|EntityDocument Returns null also when $entityId does not belong to the repository with the configured lookup.
Exceptions
EntityLookupException

Implements Wikibase\DataModel\Services\Lookup\EntityLookup.

◆ getLookupForEntityId()

Wikibase\DataModel\Services\Lookup\DispatchingEntityLookup::getLookupForEntityId ( EntityId  $entityId)
private
Parameters
EntityId$entityId
Returns
EntityLookup|null

◆ hasEntity()

Wikibase\DataModel\Services\Lookup\DispatchingEntityLookup::hasEntity ( EntityId  $entityId)
See also
EntityLookup::hasEntity
Since
3.7
Parameters
EntityId$entityId
Returns
bool Returns false also when $entityId does not belong to the repository with the configured lookup.
Exceptions
EntityLookupException

Implements Wikibase\DataModel\Services\Lookup\EntityLookup.

Member Data Documentation

◆ $lookups

Wikibase\DataModel\Services\Lookup\DispatchingEntityLookup::$lookups
private

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