WARNING: API IN FLUX.
More...
|
| __construct (SubscriptionsService $subscriptions, Queue $queue, PluginHooksService $hooks, ElggSession $session, Translator $translator, EntityTable $entities, LoggerInterface $logger) |
| Constructor. More...
|
|
| registerEvent ($type, $subtype, array $actions=[]) |
| Register a notification event. More...
|
|
| unregisterEvent ($type, $subtype) |
| Unregister a notification event. More...
|
|
| getEvents () |
| Return the notification events. More...
|
|
| registerMethod ($name) |
| Register a delivery method for notifications. More...
|
|
| unregisterMethod ($name) |
| Unregister a delivery method for notifications. More...
|
|
| getMethods () |
| Returns registered delivery methods for notifications. 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...
|
|
WARNING: API IN FLUX.
DO NOT USE DIRECTLY.
Definition at line 29 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
Definition at line 201 of file NotificationsService.php.
Elgg\Notifications\NotificationsService::getDeprecatedHandler |
( |
|
$method | ) |
|
Get a deprecated notification handler callback.
- Parameters
-
- Returns
- callback|null
Definition at line 660 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 742 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 674 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
Definition at line 233 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 650 of file NotificationsService.php.
Elgg\Notifications\NotificationsService::registerEvent |
( |
|
$type, |
|
|
|
$subtype, |
|
|
array |
$actions = [] |
|
) |
| |
Register a notification event.
- Parameters
-
string | $type | 'object', 'user', 'group', 'site' |
string | $subtype | The subtype or name of the entity |
array | $actions | Array of actions or empty array for the action event. An event is usually described by the first string passed to elgg_trigger_event(). Examples include 'create', 'update', and 'publish'. The default is 'create'. |
- Returns
- void
- See also
- elgg_register_notification_event()
Definition at line 107 of file NotificationsService.php.
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
Definition at line 361 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
Definition at line 433 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
Definition at line 305 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 720 of file NotificationsService.php.
Elgg\Notifications\NotificationsService::unregisterEvent |
( |
|
$type, |
|
|
|
$subtype |
|
) |
| |
Elgg\Notifications\NotificationsService::unregisterMethod |
( |
|
$name | ) |
|
Elgg\Notifications\NotificationsService::$deprHandlers = [] |
|
protected |
Elgg\Notifications\NotificationsService::$deprSubjects = [] |
|
protected |
Elgg\Notifications\NotificationsService::$entities |
|
protected |
Elgg\Notifications\NotificationsService::$events = [] |
|
protected |
Elgg\Notifications\NotificationsService::$hooks |
|
protected |
Elgg\Notifications\NotificationsService::$methods = [] |
|
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: