|
| __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 () |
| private More...
|
|
| registerMethod ($name) |
|
| unregisterMethod ($name) |
|
| getMethods () |
| 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.
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 private
Definition at line 170 of file NotificationsService.php.
Elgg\Notifications\NotificationsService::existsDeprecatedNotificationOverride |
( |
NotificationEvent |
$event | ) |
|
|
protected |
Elgg\Notifications\NotificationsService::getDeprecatedHandler |
( |
|
$method | ) |
|
Get a deprecated notification handler callback.
- Parameters
-
- Returns
- callback|null
Definition at line 643 of file NotificationsService.php.
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.
Elgg\Notifications\NotificationsService::getEvents |
( |
| ) |
|
Elgg\Notifications\NotificationsService::getMethods |
( |
| ) |
|
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.
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 private
Definition at line 203 of file NotificationsService.php.
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.
Elgg\Notifications\NotificationsService::registerEvent |
( |
|
$type, |
|
|
|
$subtype, |
|
|
array |
$actions = array() |
|
) |
| |
Elgg\Notifications\NotificationsService::registerMethod |
( |
|
$name | ) |
|
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
-
ElggEntity | $sender | Sender of the notification |
| ElggUser[] | $recipients An array of entities to notify |
array | $params | Notification parameters |
$params['subject'] string Default message subject $params['body'] string Default message body $params['object'] null|| The object that is triggering the notification. $params['action'] null|string Word that describes the action that is triggering the notification (e.g. "create" or "update"). Defaults to "notify_user" $params['summary'] null|string Summary that notification plugins can use alongside the notification title and body. $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 private
Definition at line 338 of file NotificationsService.php.
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 private
Definition at line 416 of file NotificationsService.php.
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 private
Definition at line 281 of file NotificationsService.php.
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.
Elgg\Notifications\NotificationsService::unregisterEvent |
( |
|
$type, |
|
|
|
$subtype |
|
) |
| |
Elgg\Notifications\NotificationsService::unregisterMethod |
( |
|
$name | ) |
|
Elgg\Notifications\NotificationsService::$deprHandlers = array() |
|
protected |
Elgg\Notifications\NotificationsService::$deprSubjects = array() |
|
protected |
Elgg\Notifications\NotificationsService::$entities |
|
protected |
Elgg\Notifications\NotificationsService::$events = array() |
|
protected |
Elgg\Notifications\NotificationsService::$hooks |
|
protected |
Elgg\Notifications\NotificationsService::$logger |
|
protected |
Elgg\Notifications\NotificationsService::$methods = array() |
|
protected |
Elgg\Notifications\NotificationsService::$queue |
|
protected |
Elgg\Notifications\NotificationsService::$session |
|
protected |
Elgg\Notifications\NotificationsService::$subscriptions |
|
protected |
Elgg\Notifications\NotificationsService::$translator |
|
protected |
const Elgg\Notifications\NotificationsService::QUEUE_NAME = 'notifications' |
The documentation for this class was generated from the following file: