Wikibase
MediaWiki Wikibase extension
|
Service for getting the closest entity (out of a specified set), from a given starting entity. More...
Public Member Functions | |
__construct (EntityLookup $entityLookup, EntityPrefetcher $entityPrefetcher, $maxDepth, $maxEntityVisits) | |
getReferencedEntityId (EntityId $fromId, PropertyId $propertyId, array $toIds) | |
Get the closest entity (out of $toIds), from a given entity. | |
Private Member Functions | |
processEntityById (EntityId $id, EntityId $fromId, PropertyId $propertyId, array $toIds, array &$toVisit) | |
Find out whether an entity (directly) references one of the target ids. | |
getEntity (EntityId $id, EntityId $fromId, PropertyId $propertyId, array $toIds) | |
processSnak (Snak $snak, array &$toVisit, array $toIds) | |
Decide whether a single Snak is pointing to one of the target ids. | |
getMainSnaks (StatementListProvider $statementListProvider, PropertyId $propertyId) | |
Private Attributes | |
$entityLookup | |
$entityPrefetcher | |
$maxDepth | |
$maxEntityVisits | |
$alreadyVisited = [] | |
Service for getting the closest entity (out of a specified set), from a given starting entity.
The starting entity, and the target entities are (potentially indirectly, via intermediate entities) linked by statements with a given property ID, pointing from the starting entity to one of the target entities.
Wikibase\DataModel\Services\Lookup\EntityRetrievingClosestReferencedEntityIdLookup::__construct | ( | EntityLookup | $entityLookup, |
EntityPrefetcher | $entityPrefetcher, | ||
$maxDepth, | |||
$maxEntityVisits ) |
EntityLookup | $entityLookup | |
EntityPrefetcher | $entityPrefetcher | |
int | $maxDepth | Maximum search depth: Maximum number of intermediate entities to search through. For example if 0 is given, only the entities immediately referenced will be found. If this limit gets exhausted, a MaxReferenceDepthExhaustedException is thrown. |
int | $maxEntityVisits | Maximum number of entities to retrieve during a lookup. If this limit gets exhausted, a MaxReferencedEntityVisitsExhaustedException is thrown. |
|
private |
EntityId | $id | Id of the entity to get |
EntityId | $fromId | Id this lookup started from |
PropertyId | $propertyId | |
EntityId[] | $toIds |
|
private |
StatementListProvider | $statementListProvider | |
PropertyId | $propertyId |
Wikibase\DataModel\Services\Lookup\EntityRetrievingClosestReferencedEntityIdLookup::getReferencedEntityId | ( | EntityId | $fromId, |
PropertyId | $propertyId, | ||
array | $toIds ) |
Get the closest entity (out of $toIds), from a given entity.
The starting entity, and the target entities are (potentially indirectly, via intermediate entities) linked by statements with the given property ID, pointing from the starting entity to one of the target entities.
EntityId | $fromId | |
PropertyId | $propertyId | |
EntityId[] | $toIds |
ReferencedEntityIdLookupException |
Implements Wikibase\DataModel\Services\Lookup\ReferencedEntityIdLookup.
|
private |
Find out whether an entity (directly) references one of the target ids.
EntityId | $id | Id of the entity to process |
EntityId | $fromId | Id this lookup started from |
PropertyId | $propertyId | |
EntityId[] | $toIds | |
EntityId[] | &$toVisit | List of entities that still need to be checked |
|
private |
Decide whether a single Snak is pointing to one of the target ids.
Snak | $snak | |
EntityId[] | &$toVisit | List of entities that still need to be checked |
EntityId[] | $toIds |
|
private |
|
private |
|
private |
|
private |
|
private |