Wikibase
MediaWiki Wikibase extension
|
EntityLookup that counts how many entities have been loaded through it and throws an exception once to many entities have been loaded. More...
Public Member Functions | |
__construct (EntityLookup $entityLookup, int $entityAccessLimit) | |
getEntity (EntityId $entityId) | |
hasEntity (EntityId $entityId) | |
getEntityAccessCount () | |
Returns the number of entities already loaded via this object. | |
reset () | |
Resets the list of entities loaded via this object. | |
entityHasBeenAccessed (EntityId $entityId) | |
Whether an entity has been accessed before via this RestrictedEntityLookup. | |
Private Attributes | |
EntityLookup | $entityLookup |
int | $entityAccessLimit |
array | $entitiesAccessed = [] |
EntityLookup that counts how many entities have been loaded through it and throws an exception once to many entities have been loaded.
This is needed to limit the number of entities that can be loaded via some user controlled features, like entity access in Lua.
Wikibase\DataModel\Services\Lookup\RestrictedEntityLookup::__construct | ( | EntityLookup | $entityLookup, |
int | $entityAccessLimit ) |
Wikibase\DataModel\Services\Lookup\RestrictedEntityLookup::entityHasBeenAccessed | ( | EntityId | $entityId | ) |
Whether an entity has been accessed before via this RestrictedEntityLookup.
Wikibase\DataModel\Services\Lookup\RestrictedEntityLookup::getEntity | ( | EntityId | $entityId | ) |
EntityId | $entityId |
EntityAccessLimitException |
Implements Wikibase\DataModel\Services\Lookup\EntityLookup.
Wikibase\DataModel\Services\Lookup\RestrictedEntityLookup::getEntityAccessCount | ( | ) |
Returns the number of entities already loaded via this object.
Wikibase\DataModel\Services\Lookup\RestrictedEntityLookup::hasEntity | ( | EntityId | $entityId | ) |
EntityLookupException |
Implements Wikibase\DataModel\Services\Lookup\EntityLookup.
Wikibase\DataModel\Services\Lookup\RestrictedEntityLookup::reset | ( | ) |
Resets the list of entities loaded via this object.
|
private |
|
private |
|
private |