SqlEntityIdPager is a cursor for iterating over the EntityIds stored in the current Wikibase installation.
More...
|
| | getEntityNamespaces (array $entityTypes) |
| |
| | processRows (IResultWrapper $rows) |
| | Processes the query result: Parse the EntityIds and compute the last position.
|
| |
SqlEntityIdPager is a cursor for iterating over the EntityIds stored in the current Wikibase installation.
- Copyright
- GPL-2.0-or-later
- Author
- Daniel Kinzler
-
Marius Hoch
◆ __construct()
| Wikibase\Repo\Store\Sql\SqlEntityIdPager::__construct |
( |
EntityNamespaceLookup | $entityNamespaceLookup, |
|
|
EntityIdLookup | $entityIdLookup, |
|
|
RepoDomainDb | $repoDomainDb, |
|
|
array | $entityTypes = [], |
|
|
| $redirectMode = EntityIdPager::NO_REDIRECTS, |
|
|
LinkCache | $linkCache = null ) |
- Parameters
-
| EntityNamespaceLookup | $entityNamespaceLookup | |
| EntityIdLookup | $entityIdLookup | |
| RepoDomainDb | $repoDomainDb | |
| string[] | $entityTypes | The desired entity types, or empty array for any type. |
| string | $redirectMode | A EntityIdPager::XXX_REDIRECTS constant (default is NO_REDIRECTS). |
| LinkCache | null | $linkCache | |
◆ fetchIds()
| Wikibase\Repo\Store\Sql\SqlEntityIdPager::fetchIds |
( |
| $limit | ) |
|
Fetches the next batch of IDs.
Calling this has the side effect of advancing the internal state of the page, typically implemented by some underlying resource such as a file pointer or a database connection.
- Note
- After some finite number of calls, this method should eventually return an empty list of IDs, indicating that no more IDs are available.
- Parameters
-
| int | $limit | The maximum number of IDs to return. |
- Returns
- EntityId[] A list of EntityIds matching the given parameters. Will be empty if there are no more entities to list from the given offset.
Implements Wikibase\DataModel\Services\EntityId\EntityIdPager.
◆ getEntityNamespaces()
| Wikibase\Repo\Store\Sql\SqlEntityIdPager::getEntityNamespaces |
( |
array | $entityTypes | ) |
|
|
private |
◆ getPosition()
| Wikibase\Repo\Store\Sql\SqlEntityIdPager::getPosition |
( |
| ) |
|
◆ processRows()
| Wikibase\Repo\Store\Sql\SqlEntityIdPager::processRows |
( |
IResultWrapper | $rows | ) |
|
|
private |
Processes the query result: Parse the EntityIds and compute the last position.
Returns an array with said entity ids and the next position or null in case the position didn't change.
- Parameters
-
- Returns
- array Tuple with ( EntityId[], int|null )
◆ setCutoffPosition()
| Wikibase\Repo\Store\Sql\SqlEntityIdPager::setCutoffPosition |
( |
| $cutoffPosition | ) |
|
- Parameters
-
| int | null | $cutoffPosition | The last page id that can be fetched. Null to allow fetching everything. |
◆ setPosition()
| Wikibase\Repo\Store\Sql\SqlEntityIdPager::setPosition |
( |
| $position | ) |
|
◆ $cutoffPosition
| Wikibase\Repo\Store\Sql\SqlEntityIdPager::$cutoffPosition = null |
|
private |
◆ $db
| Wikibase\Repo\Store\Sql\SqlEntityIdPager::$db |
|
private |
◆ $entityIdLookup
| Wikibase\Repo\Store\Sql\SqlEntityIdPager::$entityIdLookup |
|
private |
◆ $entityNamespaceLookup
| Wikibase\Repo\Store\Sql\SqlEntityIdPager::$entityNamespaceLookup |
|
private |
◆ $entityTypes
| Wikibase\Repo\Store\Sql\SqlEntityIdPager::$entityTypes |
|
private |
◆ $linkCache
| Wikibase\Repo\Store\Sql\SqlEntityIdPager::$linkCache |
|
private |
◆ $position
| Wikibase\Repo\Store\Sql\SqlEntityIdPager::$position = 0 |
|
private |
◆ $redirectMode
| Wikibase\Repo\Store\Sql\SqlEntityIdPager::$redirectMode |
|
private |
The documentation for this class was generated from the following file: