|
| | __construct (SubscriptionsService $subscriptions, Queue $queue, PluginHooksService $hooks, ElggSession $session, Translator $translator, EntityTable $entities, Logger $logger) |
| | Constructor. More...
|
| |
| | registerEvent ($type, $subtype, array $actions=array()) |
| |
| | unregisterEvent ($type, $subtype) |
| |
| | getEvents () |
| | @access private More...
|
| |
| | registerMethod ($name) |
| |
| | unregisterMethod ($name) |
| |
| | getMethods () |
| | @access private More...
|
| |
| | enqueueEvent ($action, $type, $object) |
| | Add a notification event to the queue. More...
|
| |
| | processQueue ($stopTime, $matrix=false) |
| | Pull notification events from queue until stop time is reached. More...
|
| |
| | sendInstantNotifications (\ElggEntity $sender, array $recipients=[], array $params=[]) |
| | Notify a user via their preferences. More...
|
| |
| | registerDeprecatedHandler ($method, $handler) |
| | Register a deprecated notification handler. More...
|
| |
| | getDeprecatedHandler ($method) |
| | Get a deprecated notification handler callback. More...
|
| |
| | getMethodsAsDeprecatedGlobal () |
| | Provides a way to incrementally wean Elgg's notifications code from the global $NOTIFICATION_HANDLERS. More...
|
| |
| | setDeprecatedNotificationSubject ($type, $subtype, $subject) |
| | Set message subject for deprecated notification code. More...
|
| |
Definition at line 26 of file NotificationsService.php.
◆ __construct()
◆ enqueueEvent()
| Elgg\Notifications\NotificationsService::enqueueEvent |
( |
|
$action, |
|
|
|
$type, |
|
|
|
$object |
|
) |
| |
Add a notification event to the queue.
- Parameters
-
| string | $action | Action name |
| string | $type | Type of the object of the action |
| ElggData | $object | The object of the action |
- Returns
- void @access private
Definition at line 170 of file NotificationsService.php.
◆ existsDeprecatedNotificationOverride()
| Elgg\Notifications\NotificationsService::existsDeprecatedNotificationOverride |
( |
NotificationEvent |
$event | ) |
|
|
protected |
◆ getDeprecatedHandler()
| Elgg\Notifications\NotificationsService::getDeprecatedHandler |
( |
|
$method | ) |
|
Get a deprecated notification handler callback.
- Parameters
-
- Returns
- callback|null
Definition at line 643 of file NotificationsService.php.
◆ getDeprecatedNotificationBody()
◆ getDeprecatedNotificationSubject()
| Elgg\Notifications\NotificationsService::getDeprecatedNotificationSubject |
( |
|
$type, |
|
|
|
$subtype |
|
) |
| |
|
protected |
Get the deprecated subject.
- Parameters
-
| string | $type | Entity type |
| string | $subtype | Entity subtype |
- Returns
- string
Definition at line 725 of file NotificationsService.php.
◆ getEvents()
| Elgg\Notifications\NotificationsService::getEvents |
( |
| ) |
|
◆ getMethods()
| Elgg\Notifications\NotificationsService::getMethods |
( |
| ) |
|
◆ getMethodsAsDeprecatedGlobal()
| Elgg\Notifications\NotificationsService::getMethodsAsDeprecatedGlobal |
( |
| ) |
|
Provides a way to incrementally wean Elgg's notifications code from the global $NOTIFICATION_HANDLERS.
- Returns
- array
Definition at line 657 of file NotificationsService.php.
◆ processQueue()
| Elgg\Notifications\NotificationsService::processQueue |
( |
|
$stopTime, |
|
|
|
$matrix = false |
|
) |
| |
Pull notification events from queue until stop time is reached.
- Parameters
-
| int | $stopTime | The Unix time to stop sending notifications |
| bool | $matrix | If true, will return delivery matrix instead of a notifications event count |
- Returns
- int|array The number of notification events handled, or a delivery matrix @access private
Definition at line 203 of file NotificationsService.php.
◆ registerDeprecatedHandler()
| Elgg\Notifications\NotificationsService::registerDeprecatedHandler |
( |
|
$method, |
|
|
|
$handler |
|
) |
| |
Register a deprecated notification handler.
- Parameters
-
| string | $method | Method name |
| string | $handler | Handler callback |
- Returns
- void
Definition at line 633 of file NotificationsService.php.
◆ registerEvent()
| Elgg\Notifications\NotificationsService::registerEvent |
( |
|
$type, |
|
|
|
$subtype, |
|
|
array |
$actions = array() |
|
) |
| |
◆ registerMethod()
| Elgg\Notifications\NotificationsService::registerMethod |
( |
|
$name | ) |
|
◆ sendInstantNotifications()
| Elgg\Notifications\NotificationsService::sendInstantNotifications |
( |
\ElggEntity |
$sender, |
|
|
array |
$recipients = [], |
|
|
array |
$params = [] |
|
) |
| |
Notify a user via their preferences.
Returns an array in the form: [ 25 => [ 'email' => true, 'sms' => false, ], 55 => [], ]
- Parameters
-
@uses $params['subject'] string Default message subject @uses $params['body'] string Default message body @uses $params['object'] null|\ElggEntity|\ElggAnnotation The object that is triggering the notification. @uses $params['action'] null|string Word that describes the action that is triggering the notification (e.g. "create" or "update"). Defaults to "notify_user" @uses $params['summary'] null|string Summary that notification plugins can use alongside the notification title and body. @uses $params['methods_override'] string|array A string, or an array of strings specifying the delivery methods to use - or leave blank for delivery using the user's chosen delivery methods.
- Returns
- array @access private
Definition at line 338 of file NotificationsService.php.
◆ sendNotification()
| Elgg\Notifications\NotificationsService::sendNotification |
( |
NotificationEvent |
$event, |
|
|
|
$guid, |
|
|
|
$method, |
|
|
array |
$params = [] |
|
) |
| |
|
protected |
Send a notification to a subscriber.
- Parameters
-
| NotificationEvent | $event | The notification event |
| int | $guid | The guid of the subscriber |
| string | $method | The notification method |
| array | $params | Default notification params |
- Returns
- bool @access private
Definition at line 416 of file NotificationsService.php.
◆ sendNotifications()
| Elgg\Notifications\NotificationsService::sendNotifications |
( |
|
$event, |
|
|
|
$subscriptions, |
|
|
array |
$params = [] |
|
) |
| |
|
protected |
Sends the notifications based on subscriptions.
Returns an array in the form: [ 25 => [ 'email' => true, 'sms' => false, ], 55 => [], ]
- Parameters
-
- Returns
- array @access private
Definition at line 281 of file NotificationsService.php.
◆ setDeprecatedNotificationSubject()
| Elgg\Notifications\NotificationsService::setDeprecatedNotificationSubject |
( |
|
$type, |
|
|
|
$subtype, |
|
|
|
$subject |
|
) |
| |
Set message subject for deprecated notification code.
- Parameters
-
| string | $type | Entity type |
| string | $subtype | Entity subtype |
| string | $subject | Subject line |
- Returns
- void
Definition at line 703 of file NotificationsService.php.
◆ unregisterEvent()
| Elgg\Notifications\NotificationsService::unregisterEvent |
( |
|
$type, |
|
|
|
$subtype |
|
) |
| |
◆ unregisterMethod()
| Elgg\Notifications\NotificationsService::unregisterMethod |
( |
|
$name | ) |
|
◆ $deprHandlers
| Elgg\Notifications\NotificationsService::$deprHandlers = array() |
|
protected |
◆ $deprSubjects
| Elgg\Notifications\NotificationsService::$deprSubjects = array() |
|
protected |
◆ $entities
| Elgg\Notifications\NotificationsService::$entities |
|
protected |
◆ $events
| Elgg\Notifications\NotificationsService::$events = array() |
|
protected |
◆ $hooks
| Elgg\Notifications\NotificationsService::$hooks |
|
protected |
◆ $logger
| Elgg\Notifications\NotificationsService::$logger |
|
protected |
◆ $methods
| Elgg\Notifications\NotificationsService::$methods = array() |
|
protected |
◆ $queue
| Elgg\Notifications\NotificationsService::$queue |
|
protected |
◆ $session
| Elgg\Notifications\NotificationsService::$session |
|
protected |
◆ $subscriptions
| Elgg\Notifications\NotificationsService::$subscriptions |
|
protected |
◆ $translator
| Elgg\Notifications\NotificationsService::$translator |
|
protected |
◆ QUEUE_NAME
| const Elgg\Notifications\NotificationsService::QUEUE_NAME = 'notifications' |
The documentation for this class was generated from the following file: