Manage user subscriptions to message groups and trigger notifications. More...
Public Member Functions | |
__construct (MessageGroupSubscriptionStore $groupSubscriptionStore, JobQueueGroup $jobQueueGroup, UserIdentityLookup $userIdentityLookup, LoggerInterface $logger, ServiceOptions $options) | |
isEnabled () | |
subscribeToGroup (MessageGroup $group, User $user) | |
isUserSubscribedTo (MessageGroup $group, UserIdentity $user) | |
unsubscribeFromGroup (MessageGroup $group, UserIdentity $user) | |
unsubscribeFromGroupsById (array $groupIds, UserIdentity $user) | |
subscribeToGroupsById (array $groupIds, UserIdentity $user) | |
getUserSubscriptions (UserIdentity $user) | |
queueMessage (Title $messageTitle, string $state, string $groupId) | |
Queue a message / group to send notifications for. | |
queueNotificationJob () | |
sendNotifications (array $changesToProcess) | |
getGroupSubscribers (string $groupId) | |
Given a group id returns an iterator to the subscribers of that group. | |
getGroupSubscriberUnion (array $groupIds) | |
Return a list of users ids that belong to all the given groups. | |
setMockEventCreator (MockEventCreator $mockEventCreator) | |
canUserSubscribeToGroup (MessageGroup $group, User $user) | |
Public Attributes | |
const | STATE_ADDED = 'added' |
const | STATE_UPDATED = 'updated' |
const | CONSTRUCTOR_OPTIONS = [ 'TranslateEnableMessageGroupSubscription' ] |
const | NOT_ENABLED = 'mgs-not-enabled' |
const | UNNAMED_USER_UNSUPPORTED = 'mgs-unnamed-user-unsupported' |
const | DYNAMIC_GROUP_UNSUPPORTED = 'mgs-dynamic-group-unsupported' |
Manage user subscriptions to message groups and trigger notifications.
Definition at line 25 of file MessageGroupSubscription.php.
MediaWiki\Extension\Translate\MessageGroupProcessing\MessageGroupSubscription::__construct | ( | MessageGroupSubscriptionStore | $groupSubscriptionStore, |
JobQueueGroup | $jobQueueGroup, | ||
UserIdentityLookup | $userIdentityLookup, | ||
LoggerInterface | $logger, | ||
ServiceOptions | $options ) |
Definition at line 42 of file MessageGroupSubscription.php.
MediaWiki\Extension\Translate\MessageGroupProcessing\MessageGroupSubscription::canUserSubscribeToGroup | ( | MessageGroup | $group, |
User | $user ) |
Definition at line 280 of file MessageGroupSubscription.php.
MediaWiki\Extension\Translate\MessageGroupProcessing\MessageGroupSubscription::getGroupSubscribers | ( | string | $groupId | ) |
Given a group id returns an iterator to the subscribers of that group.
Returns an EmptyIterator if there are no subscribers
Definition at line 231 of file MessageGroupSubscription.php.
MediaWiki\Extension\Translate\MessageGroupProcessing\MessageGroupSubscription::getGroupSubscriberUnion | ( | array | $groupIds | ) |
Return a list of users ids that belong to all the given groups.
Definition at line 248 of file MessageGroupSubscription.php.
MediaWiki\Extension\Translate\MessageGroupProcessing\MessageGroupSubscription::getUserSubscriptions | ( | UserIdentity | $user | ) |
Definition at line 94 of file MessageGroupSubscription.php.
MediaWiki\Extension\Translate\MessageGroupProcessing\MessageGroupSubscription::isEnabled | ( | ) |
Definition at line 57 of file MessageGroupSubscription.php.
MediaWiki\Extension\Translate\MessageGroupProcessing\MessageGroupSubscription::isUserSubscribedTo | ( | MessageGroup | $group, |
UserIdentity | $user ) |
Definition at line 71 of file MessageGroupSubscription.php.
MediaWiki\Extension\Translate\MessageGroupProcessing\MessageGroupSubscription::queueMessage | ( | Title | $messageTitle, |
string | $state, | ||
string | $groupId ) |
Queue a message / group to send notifications for.
Title | $messageTitle | |
string | $state |
Definition at line 109 of file MessageGroupSubscription.php.
MediaWiki\Extension\Translate\MessageGroupProcessing\MessageGroupSubscription::queueNotificationJob | ( | ) |
Definition at line 113 of file MessageGroupSubscription.php.
MediaWiki\Extension\Translate\MessageGroupProcessing\MessageGroupSubscription::sendNotifications | ( | array | $changesToProcess | ) |
array<string,array<string,array<int,string>>> | $changesToProcess Group ID → state → array of message prefixed DB keys map |
Definition at line 131 of file MessageGroupSubscription.php.
MediaWiki\Extension\Translate\MessageGroupProcessing\MessageGroupSubscription::setMockEventCreator | ( | MockEventCreator | $mockEventCreator | ) |
Definition at line 259 of file MessageGroupSubscription.php.
MediaWiki\Extension\Translate\MessageGroupProcessing\MessageGroupSubscription::subscribeToGroup | ( | MessageGroup | $group, |
User | $user ) |
Definition at line 61 of file MessageGroupSubscription.php.
MediaWiki\Extension\Translate\MessageGroupProcessing\MessageGroupSubscription::subscribeToGroupsById | ( | array | $groupIds, |
UserIdentity | $user ) |
Definition at line 86 of file MessageGroupSubscription.php.
MediaWiki\Extension\Translate\MessageGroupProcessing\MessageGroupSubscription::unsubscribeFromGroup | ( | MessageGroup | $group, |
UserIdentity | $user ) |
Definition at line 75 of file MessageGroupSubscription.php.
MediaWiki\Extension\Translate\MessageGroupProcessing\MessageGroupSubscription::unsubscribeFromGroupsById | ( | array | $groupIds, |
UserIdentity | $user ) |
Definition at line 79 of file MessageGroupSubscription.php.
const MediaWiki\Extension\Translate\MessageGroupProcessing\MessageGroupSubscription::CONSTRUCTOR_OPTIONS = [ 'TranslateEnableMessageGroupSubscription' ] |
Definition at line 36 of file MessageGroupSubscription.php.
const MediaWiki\Extension\Translate\MessageGroupProcessing\MessageGroupSubscription::DYNAMIC_GROUP_UNSUPPORTED = 'mgs-dynamic-group-unsupported' |
Definition at line 40 of file MessageGroupSubscription.php.
const MediaWiki\Extension\Translate\MessageGroupProcessing\MessageGroupSubscription::NOT_ENABLED = 'mgs-not-enabled' |
Definition at line 38 of file MessageGroupSubscription.php.
const MediaWiki\Extension\Translate\MessageGroupProcessing\MessageGroupSubscription::STATE_ADDED = 'added' |
Definition at line 34 of file MessageGroupSubscription.php.
const MediaWiki\Extension\Translate\MessageGroupProcessing\MessageGroupSubscription::STATE_UPDATED = 'updated' |
Definition at line 35 of file MessageGroupSubscription.php.
const MediaWiki\Extension\Translate\MessageGroupProcessing\MessageGroupSubscription::UNNAMED_USER_UNSUPPORTED = 'mgs-unnamed-user-unsupported' |
Definition at line 39 of file MessageGroupSubscription.php.