EntityLookup that counts how many entities have been loaded through it and throws an exception once to many entities have been loaded.
More...
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.
- Since
- 2.0
- Copyright
- GPL-2.0-or-later
- Author
- Marius Hoch < hoo@o.nosp@m.nlin.nosp@m.e.de >
◆ __construct()
Wikibase\DataModel\Services\Lookup\RestrictedEntityLookup::__construct |
( |
EntityLookup | $entityLookup, |
|
|
| $entityAccessLimit ) |
- Parameters
-
EntityLookup | $entityLookup | |
int | $entityAccessLimit | |
- Exceptions
-
◆ entityHasBeenAccessed()
Wikibase\DataModel\Services\Lookup\RestrictedEntityLookup::entityHasBeenAccessed |
( |
EntityId | $entityId | ) |
|
Whether an entity has been accessed before via this RestrictedEntityLookup.
- Since
- 2.0
- Parameters
-
- Returns
- bool
◆ getEntity()
Wikibase\DataModel\Services\Lookup\RestrictedEntityLookup::getEntity |
( |
EntityId | $entityId | ) |
|
◆ getEntityAccessCount()
Wikibase\DataModel\Services\Lookup\RestrictedEntityLookup::getEntityAccessCount |
( |
| ) |
|
Returns the number of entities already loaded via this object.
- Since
- 2.0
- Returns
- int
◆ hasEntity()
Wikibase\DataModel\Services\Lookup\RestrictedEntityLookup::hasEntity |
( |
EntityId | $entityId | ) |
|
◆ reset()
Wikibase\DataModel\Services\Lookup\RestrictedEntityLookup::reset |
( |
| ) |
|
Resets the number and list of entities loaded via this object.
- Since
- 3.4
◆ $entitiesAccessed
Wikibase\DataModel\Services\Lookup\RestrictedEntityLookup::$entitiesAccessed = [] |
|
private |
◆ $entityAccessCount
Wikibase\DataModel\Services\Lookup\RestrictedEntityLookup::$entityAccessCount = 0 |
|
private |
◆ $entityAccessLimit
Wikibase\DataModel\Services\Lookup\RestrictedEntityLookup::$entityAccessLimit |
|
private |
◆ $entityLookup
Wikibase\DataModel\Services\Lookup\RestrictedEntityLookup::$entityLookup |
|
private |
The documentation for this class was generated from the following file: