PHP 클래스 Elgg\Notifications\NotificationsService

부터: 1.9.0
파일 보기 프로젝트 열기: elgg/elgg 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$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

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