EntityLookup that uses an in memory array to retrieve the requested information.
More...
EntityLookup that uses an in memory array to retrieve the requested information.
One can also specify exceptions that should be thrown when an entity with their associated ID is requested.
This class can be used as a fake in tests.
- Since
- 2.0
- Copyright
- GPL-2.0-or-later
- Author
- Jeroen De Dauw < jeroe.nosp@m.nded.nosp@m.auw@g.nosp@m.mail.nosp@m..com >
◆ __construct()
Wikibase\DataModel\Services\Lookup\InMemoryEntityLookup::__construct |
( |
| $entities | ) |
|
- Parameters
-
EntityDocument | ...$entities |
◆ addEntity()
Wikibase\DataModel\Services\Lookup\InMemoryEntityLookup::addEntity |
( |
EntityDocument | $entity | ) |
|
◆ addException()
Wikibase\DataModel\Services\Lookup\InMemoryEntityLookup::addException |
( |
EntityLookupException | $exception | ) |
|
Registers an exception that will be thrown when a entity with the id in the exception is requested.
If an exception with the same EntityId was already present it will be replaced by the new one.
- Since
- 3.1
- Parameters
-
EntityLookupException | $exception | |
◆ getEntity()
Wikibase\DataModel\Services\Lookup\InMemoryEntityLookup::getEntity |
( |
EntityId | $entityId | ) |
|
◆ getItemForId()
Wikibase\DataModel\Services\Lookup\InMemoryEntityLookup::getItemForId |
( |
ItemId | $itemId | ) |
|
◆ getPropertyForId()
Wikibase\DataModel\Services\Lookup\InMemoryEntityLookup::getPropertyForId |
( |
PropertyId | $propertyId | ) |
|
◆ hasEntity()
Wikibase\DataModel\Services\Lookup\InMemoryEntityLookup::hasEntity |
( |
EntityId | $entityId | ) |
|
◆ throwExceptionIfNeeded()
Wikibase\DataModel\Services\Lookup\InMemoryEntityLookup::throwExceptionIfNeeded |
( |
EntityId | $entityId | ) |
|
|
private |
◆ $entities
Wikibase\DataModel\Services\Lookup\InMemoryEntityLookup::$entities = [] |
|
private |
◆ $exceptions
Wikibase\DataModel\Services\Lookup\InMemoryEntityLookup::$exceptions = [] |
|
private |
The documentation for this class was generated from the following file: