PHP Класс Elgg\Notifications\NotificationsService

С версии: 1.9.0
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$deprHandlers Deprecated notification handlers
$deprSubjects Deprecated message subjects
$entities Elgg\Database\EntityTable
$events Registered notification events
$hooks Elgg\PluginHooksService
$logger Elgg\Logger
$methods Registered notification methods
$queue Elgg\Queue\Queue
$session ElggSessio\ElggSession
$subscriptions SubscriptionsService
$translator Elgg\I18n\Translator

Открытые методы

Метод Описание
__construct ( SubscriptionsService $subscriptions, Elgg\Queue\Queue $queue, PluginHooksService $hooks, ElggSessio\ElggSession $session, Translator $translator, EntityTable $entities, Logger $logger ) Constructor
enqueueEvent ( string $action, string $type, ElggDat\ElggData $object ) : void Add a notification event to the queue
getDeprecatedHandler ( string $method ) : callback | null Get a deprecated notification handler callback
getEvents ( )
getMethods ( )
getMethodsAsDeprecatedGlobal ( ) : array Provides a way to incrementally wean Elgg's notifications code from the global $NOTIFICATION_HANDLERS
processQueue ( integer $stopTime, boolean $matrix = false ) : integer | array Pull notification events from queue until stop time is reached
registerDeprecatedHandler ( string $method, string $handler ) : void Register a deprecated notification handler
registerEvent ( $type, $subtype, array $actions = [] )
registerMethod ( $name )
sendInstantNotifications ( ElggEntity $sender, array $recipients = [], array $params = [] ) : array Notify a user via their preferences.
setDeprecatedNotificationSubject ( string $type, string $subtype, string $subject ) : void Set message subject for deprecated notification code
unregisterEvent ( $type, $subtype )
unregisterMethod ( $name )

Защищенные методы

Метод Описание
getDeprecatedNotificationBody ( Notification $notification, Elgg\Notifications\NotificationEvent $event, string $method ) : Notification Get the notification body using a pre-Elgg 1.9 plugin hook
getDeprecatedNotificationSubject ( string $type, string $subtype ) : string Get the deprecated subject
sendNotification ( Elgg\Notifications\NotificationEvent $event, integer $guid, string $method, array $params = [] ) : boolean Send a notification to a subscriber
sendNotifications ( Elgg\Notifications\NotificationEvent $event, array $subscriptions, array $params = [] ) : array Sends the notifications based on subscriptions

Приватные методы

Метод Описание
getNotificationBody ( Elgg\Notifications\NotificationEvent $event, ElggUse\ElggUser $recipient ) : string Get body for the notification
getNotificationSubject ( Elgg\Notifications\NotificationEvent $event, ElggUse\ElggUser $recipient ) : string Get subject for the notification

Описание методов

__construct() публичный Метод

Constructor
public __construct ( SubscriptionsService $subscriptions, Elgg\Queue\Queue $queue, PluginHooksService $hooks, ElggSessio\ElggSession $session, Translator $translator, EntityTable $entities, Logger $logger )
$subscriptions SubscriptionsService Subscription service
$queue Elgg\Queue\Queue Queue
$hooks Elgg\PluginHooksService Plugin hook service
$session ElggSessio\ElggSession Session service
$translator Elgg\I18n\Translator Translator
$entities Elgg\Database\EntityTable Entity table
$logger Elgg\Logger Logger

enqueueEvent() публичный Метод

Add a notification event to the queue
public enqueueEvent ( string $action, string $type, ElggDat\ElggData $object ) : void
$action string Action name
$type string Type of the object of the action
$object ElggDat\ElggData The object of the action
Результат void

getDeprecatedHandler() публичный Метод

Get a deprecated notification handler callback
public getDeprecatedHandler ( string $method ) : callback | null
$method string Method name
Результат callback | null

getDeprecatedNotificationBody() защищенный Метод

Get the notification body using a pre-Elgg 1.9 plugin hook
protected getDeprecatedNotificationBody ( Notification $notification, Elgg\Notifications\NotificationEvent $event, string $method ) : Notification
$notification Notification Notification
$event Elgg\Notifications\NotificationEvent Event
$method string Method
Результат Notification

getDeprecatedNotificationSubject() защищенный Метод

Get the deprecated subject
protected getDeprecatedNotificationSubject ( string $type, string $subtype ) : string
$type string Entity type
$subtype string Entity subtype
Результат string

getEvents() публичный Метод

public getEvents ( )

getMethods() публичный Метод

public getMethods ( )

getMethodsAsDeprecatedGlobal() публичный Метод

Provides a way to incrementally wean Elgg's notifications code from the global $NOTIFICATION_HANDLERS
public getMethodsAsDeprecatedGlobal ( ) : array
Результат array

processQueue() публичный Метод

Pull notification events from queue until stop time is reached
public processQueue ( integer $stopTime, boolean $matrix = false ) : integer | array
$stopTime integer The Unix time to stop sending notifications
$matrix boolean If true, will return delivery matrix instead of a notifications event count
Результат integer | array The number of notification events handled, or a delivery matrix

registerDeprecatedHandler() публичный Метод

Register a deprecated notification handler
public registerDeprecatedHandler ( string $method, string $handler ) : void
$method string Method name
$handler string Handler callback
Результат void

registerEvent() публичный Метод

См. также: elgg_register_notification_event()
public registerEvent ( $type, $subtype, array $actions = [] )
$actions array

registerMethod() публичный Метод

См. также: elgg_register_notification_method()
public registerMethod ( $name )

sendInstantNotifications() публичный Метод

Returns an array in the form: [ 25 => [ 'email' => true, 'sms' => false, ], 55 => [], ]
public sendInstantNotifications ( ElggEntity $sender, array $recipients = [], array $params = [] ) : array
$sender ElggEntity Sender of the notification
$recipients array An array of entities to notify
$params array Notification parameters
Результат array

sendNotification() защищенный Метод

Send a notification to a subscriber
protected sendNotification ( Elgg\Notifications\NotificationEvent $event, integer $guid, string $method, array $params = [] ) : boolean
$event Elgg\Notifications\NotificationEvent The notification event
$guid integer The guid of the subscriber
$method string The notification method
$params array Default notification params
Результат boolean

sendNotifications() защищенный Метод

Returns an array in the form: [ 25 => [ 'email' => true, 'sms' => false, ], 55 => [], ]
protected sendNotifications ( Elgg\Notifications\NotificationEvent $event, array $subscriptions, array $params = [] ) : array
$event Elgg\Notifications\NotificationEvent Notification event
$subscriptions array Subscriptions for this event
$params array Default notification parameters
Результат array

setDeprecatedNotificationSubject() публичный Метод

Set message subject for deprecated notification code
public setDeprecatedNotificationSubject ( string $type, string $subtype, string $subject ) : void
$type string Entity type
$subtype string Entity subtype
$subject string Subject line
Результат void

unregisterEvent() публичный Метод

См. также: elgg_unregister_notification_event()
public unregisterEvent ( $type, $subtype )

unregisterMethod() публичный Метод

См. также: elgg_unregister_notification_method()
public unregisterMethod ( $name )

Описание свойств

$deprHandlers защищенное свойство

Deprecated notification handlers
protected $deprHandlers

$deprSubjects защищенное свойство

Deprecated message subjects
protected $deprSubjects

$entities защищенное свойство

protected EntityTable,Elgg\Database $entities
Результат Elgg\Database\EntityTable

$events защищенное свойство

Registered notification events
protected $events

$hooks защищенное свойство

protected PluginHooksService,Elgg $hooks
Результат Elgg\PluginHooksService

$logger защищенное свойство

protected Logger,Elgg $logger
Результат Elgg\Logger

$methods защищенное свойство

Registered notification methods
protected $methods

$queue защищенное свойство

protected Queue,Elgg\Queue $queue
Результат Elgg\Queue\Queue

$session защищенное свойство

protected ElggSession,ElggSessio $session
Результат ElggSessio\ElggSession

$subscriptions защищенное свойство

protected SubscriptionsService,Elgg\Notifications $subscriptions
Результат SubscriptionsService

$translator защищенное свойство

protected Translator,Elgg\I18n $translator
Результат Elgg\I18n\Translator