| Current File : /home/jvzmxxx/wiki/extensions/Wikibase/client/includes/Usage/UsageLookup.php |
<?php
namespace Wikibase\Client\Usage;
use Traversable;
use Wikibase\DataModel\Entity\EntityId;
/**
* Service interface looking up the usage of entities across pages on the local wiki.
*
* @see docs/usagetracking.wiki
*
* @license GPL-2.0+
* @author Daniel Kinzler
*/
interface UsageLookup {
/**
* Get the entities used on the given page.
*
* @param int $pageId
*
* @return EntityUsage[]
* @throws UsageTrackerException
*/
public function getUsagesForPage( $pageId );
/**
* Returns the pages that use any of the given entities.
*
* @param EntityId[] $entityIds
* @param string[] $aspects Which aspects to consider (if omitted, all aspects are considered).
* Use the EntityUsage::XXX_USAGE constants to represent aspects.
*
* @return Traversable A traversable over PageEntityUsages of pages using any of the given
* entities. If $aspects is given, only usages of these aspects are included in the result.
* @throws UsageTrackerException
*/
public function getPagesUsing( array $entityIds, array $aspects = array() );
/**
* Returns the elements of $entityIds that are currently not used as
* far as this UsageTracker knows. In other words, this method answers the
* question which of a given list of entities are currently being used on
* wiki pages.
*
* @param EntityId[] $entityIds
*
* @return EntityId[] A list of elements of $entityIds that are unused.
* @throws UsageTrackerException
*/
public function getUnusedEntities( array $entityIds );
}