Wikibase
MediaWiki Wikibase extension
Wikibase\Repo\Store\Sql\SqlSubscriptionLookup Class Reference

Implementation of SubscriptionLookup based on a database table. More...

+ Inheritance diagram for Wikibase\Repo\Store\Sql\SqlSubscriptionLookup:
+ Collaboration diagram for Wikibase\Repo\Store\Sql\SqlSubscriptionLookup:

Public Member Functions

 __construct (ILoadBalancer $dbLoadBalancer)
 
 getSubscriptions ( $siteId, array $entityIds)
 Returns a list of entities a given site is subscribed to. More...
 
 getSubscribers (EntityId $idToCheck)
 Return the existing subscriptions for given Id to check. More...
 

Private Member Functions

 querySubscriptions (IDatabase $db, $subscriber, array $idsToCheck=null)
 For a set of potential subscriptions, returns the existing subscriptions. More...
 
 reIndexEntityIds (array $entityIds)
 

Private Attributes

 $dbLoadBalancer
 

Detailed Description

Implementation of SubscriptionLookup based on a database table.

Author
Daniel Kinzler

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Repo\Store\Sql\SqlSubscriptionLookup::__construct ( ILoadBalancer  $dbLoadBalancer)

Member Function Documentation

◆ getSubscribers()

Wikibase\Repo\Store\Sql\SqlSubscriptionLookup::getSubscribers ( EntityId  $idToCheck)

Return the existing subscriptions for given Id to check.

Parameters
EntityId$idToCheckEntityId to get subscribers
Returns
string[] wiki IDs of wikis subscribed to the given entity

Implements Wikibase\Repo\Store\SubscriptionLookup.

◆ getSubscriptions()

Wikibase\Repo\Store\Sql\SqlSubscriptionLookup::getSubscriptions (   $siteId,
array  $entityIds 
)

Returns a list of entities a given site is subscribed to.

Parameters
string$siteIdSite ID of the client site.
EntityId[]$entityIdsThe entities we are interested in, or null for "any".
Returns
EntityId[] a list of entity IDs the client wiki is subscribed to. The result is limited to entity ids also present in $entityIds, if given.

Implements Wikibase\Repo\Store\SubscriptionLookup.

◆ querySubscriptions()

Wikibase\Repo\Store\Sql\SqlSubscriptionLookup::querySubscriptions ( IDatabase  $db,
  $subscriber,
array  $idsToCheck = null 
)
private

For a set of potential subscriptions, returns the existing subscriptions.

Parameters
IDatabase$db
string$subscriber
string[] | null$idsToCheckId strings to check
Returns
string[] Entity ID strings from $subscriptions which $subscriber is subscribed to.

◆ reIndexEntityIds()

Wikibase\Repo\Store\Sql\SqlSubscriptionLookup::reIndexEntityIds ( array  $entityIds)
private
Parameters
EntityId[]$entityIds
Returns
EntityId[] The ItemIds from EntityId[], keyed by numeric id.

Member Data Documentation

◆ $dbLoadBalancer

Wikibase\Repo\Store\Sql\SqlSubscriptionLookup::$dbLoadBalancer
private

The documentation for this class was generated from the following file: