Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Wikibase\Client\Usage\Sql\SqlSubscriptionManager Class Reference

SubscriptionManager implementation backed by an SQL table. More...

+ Inheritance diagram for Wikibase\Client\Usage\Sql\SqlSubscriptionManager:
+ Collaboration diagram for Wikibase\Client\Usage\Sql\SqlSubscriptionManager:

Public Member Functions

 __construct (SessionConsistentConnectionManager $connectionManager)
 
 subscribe (string $subscriber, array $entityIds)
 
 unsubscribe (string $subscriber, array $entityIds)
 

Private Member Functions

 idsToString (array $entityIds)
 
 querySubscriptions (IReadableDatabase $db, string $subscriber, array $subscriptions)
 For a set of potential subscriptions, returns the existing subscriptions.
 
 insertSubscriptions (IDatabase $db, string $subscriber, array $subscriptions)
 Inserts a set of subscriptions.
 
 deleteSubscriptions (IDatabase $db, string $subscriber, array $subscriptions)
 Inserts a set of subscriptions.
 
 makeSubscriptionRows (string $subscriber, array $subscriptions)
 Returns a list of rows for insertion, using IDatabase's multi-row insert mechanism.
 

Private Attributes

 $connectionManager
 

Detailed Description

SubscriptionManager implementation backed by an SQL table.

See also
docs/usagetracking.wiki
Author
Daniel Kinzler

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Client\Usage\Sql\SqlSubscriptionManager::__construct ( SessionConsistentConnectionManager $connectionManager)

Member Function Documentation

◆ deleteSubscriptions()

Wikibase\Client\Usage\Sql\SqlSubscriptionManager::deleteSubscriptions ( IDatabase $db,
string $subscriber,
array $subscriptions )
private

Inserts a set of subscriptions.

Parameters
IDatabase$db
string$subscriber
string[]$subscriptions

◆ idsToString()

Wikibase\Client\Usage\Sql\SqlSubscriptionManager::idsToString ( array $entityIds)
private
Parameters
EntityId[]$entityIds
Returns
string[]

◆ insertSubscriptions()

Wikibase\Client\Usage\Sql\SqlSubscriptionManager::insertSubscriptions ( IDatabase $db,
string $subscriber,
array $subscriptions )
private

Inserts a set of subscriptions.

Parameters
IDatabase$db
string$subscriber
string[]$subscriptions

◆ makeSubscriptionRows()

Wikibase\Client\Usage\Sql\SqlSubscriptionManager::makeSubscriptionRows ( string $subscriber,
array $subscriptions )
private

Returns a list of rows for insertion, using IDatabase's multi-row insert mechanism.

Each row is represented as [ $subscriber, $entityId ].

Parameters
string$subscriber
string[]$subscriptions
Returns
array[] rows

◆ querySubscriptions()

Wikibase\Client\Usage\Sql\SqlSubscriptionManager::querySubscriptions ( IReadableDatabase $db,
string $subscriber,
array $subscriptions )
private

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

Parameters
IReadableDatabase$db
string$subscriber
string[]$subscriptions
Returns
string[] Entity ID strings from $subscriptions which $subscriber is already subscribed to.

◆ subscribe()

Wikibase\Client\Usage\Sql\SqlSubscriptionManager::subscribe ( string $subscriber,
array $entityIds )
See also
SubscriptionManager::subscribe
Parameters
string$subscriber
EntityId[]$entityIds
Exceptions
InvalidArgumentException
Exception

Implements Wikibase\Client\Usage\SubscriptionManager.

◆ unsubscribe()

Wikibase\Client\Usage\Sql\SqlSubscriptionManager::unsubscribe ( string $subscriber,
array $entityIds )
See also
SubscriptionManager::unsubscribe
Parameters
string$subscriberGlobal site ID of the client
EntityId[]$entityIdsThe entities to subscribe to.
Exceptions
InvalidArgumentException
Exception

Implements Wikibase\Client\Usage\SubscriptionManager.

Member Data Documentation

◆ $connectionManager

Wikibase\Client\Usage\Sql\SqlSubscriptionManager::$connectionManager
private

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