Elgg  Version 1.12
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
Elgg\Notifications\NotificationsService Class Reference

Public Member Functions

 __construct (\Elgg\Notifications\SubscriptionsService $subscriptions,\Elgg\Queue\Queue $queue,\Elgg\PluginHooksService $hooks,\ElggSession $session)
 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)
 Pull notification events from queue until stop time is reached. 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...
 

Public Attributes

const QUEUE_NAME = 'notifications'
 

Protected Member Functions

 sendNotifications ($event, $subscriptions)
 Sends the notifications based on subscriptions. More...
 
 sendNotification (\Elgg\Notifications\Event $event, $guid, $method)
 Send a notification to a subscriber. More...
 
 getDeprecatedNotificationBody (\Elgg\Notifications\Notification $notification,\Elgg\Notifications\Event $event, $method)
 Get the notification body using a pre-Elgg 1.9 plugin hook. More...
 
 getDeprecatedNotificationSubject ($type, $subtype)
 Get the deprecated subject. More...
 
 existsDeprecatedNotificationOverride (\Elgg\Notifications\Event $event)
 Is someone using the deprecated override. More...
 

Protected Attributes

 $subscriptions
 
 $queue
 
 $hooks
 
 $session
 
 $events = array()
 
 $methods = array()
 
 $deprHandlers = array()
 
 $deprSubjects = array()
 

Detailed Description

Definition at line 15 of file NotificationsService.php.

Constructor & Destructor Documentation

Elgg\Notifications\NotificationsService::__construct ( \Elgg\Notifications\SubscriptionsService  $subscriptions,
\Elgg\Queue\Queue  $queue,
\Elgg\PluginHooksService  $hooks,
\ElggSession  $session 
)

Constructor.

Parameters
\Elgg\Notifications\SubscriptionsService$subscriptionsSubscription service
\Elgg\Queue\Queue$queueQueue
\Elgg\PluginHooksService$hooksPlugin hook service
\ElggSession$sessionSession service

Definition at line 51 of file NotificationsService.php.

Member Function Documentation

Elgg\Notifications\NotificationsService::enqueueEvent (   $action,
  $type,
  $object 
)

Add a notification event to the queue.

Parameters
string$actionAction name
string$typeType of the object of the action
\ElggData$objectThe object of the action
Returns
void private

Definition at line 138 of file NotificationsService.php.

Elgg\Notifications\NotificationsService::existsDeprecatedNotificationOverride ( \Elgg\Notifications\Event  $event)
protected

Is someone using the deprecated override.

Parameters
\Elgg\Notifications\Event$eventEvent
Returns
boolean

Definition at line 429 of file NotificationsService.php.

Elgg\Notifications\NotificationsService::getDeprecatedHandler (   $method)

Get a deprecated notification handler callback.

Parameters
string$methodMethod name
Returns
callback|null

Definition at line 325 of file NotificationsService.php.

Elgg\Notifications\NotificationsService::getDeprecatedNotificationBody ( \Elgg\Notifications\Notification  $notification,
\Elgg\Notifications\Event  $event,
  $method 
)
protected

Get the notification body using a pre-Elgg 1.9 plugin hook.

Parameters
\Elgg\Notifications\Notification$notificationNotification
\Elgg\Notifications\Event$eventEvent
string$methodMethod
Returns

Definition at line 355 of file NotificationsService.php.

Elgg\Notifications\NotificationsService::getDeprecatedNotificationSubject (   $type,
  $subtype 
)
protected

Get the deprecated subject.

Parameters
string$typeEntity type
string$subtypeEntity subtype
Returns
string

Definition at line 404 of file NotificationsService.php.

Elgg\Notifications\NotificationsService::getEvents ( )

private

Definition at line 98 of file NotificationsService.php.

Elgg\Notifications\NotificationsService::getMethods ( )

private

Definition at line 125 of file NotificationsService.php.

Elgg\Notifications\NotificationsService::getMethodsAsDeprecatedGlobal ( )

Provides a way to incrementally wean Elgg's notifications code from the global $NOTIFICATION_HANDLERS.

Returns
array

Definition at line 339 of file NotificationsService.php.

Elgg\Notifications\NotificationsService::processQueue (   $stopTime)

Pull notification events from queue until stop time is reached.

Parameters
int$stopTimeThe Unix time to stop sending notifications
Returns
int The number of notification events handled private

Definition at line 171 of file NotificationsService.php.

Elgg\Notifications\NotificationsService::registerDeprecatedHandler (   $method,
  $handler 
)

Register a deprecated notification handler.

Parameters
string$methodMethod name
string$handlerHandler callback
Returns
void

Definition at line 315 of file NotificationsService.php.

Elgg\Notifications\NotificationsService::registerEvent (   $type,
  $subtype,
array  $actions = array() 
)
See also
elgg_register_notification_event() private

Definition at line 63 of file NotificationsService.php.

Elgg\Notifications\NotificationsService::registerMethod (   $name)
See also
elgg_register_notification_method() private

Definition at line 106 of file NotificationsService.php.

Elgg\Notifications\NotificationsService::sendNotification ( \Elgg\Notifications\Event  $event,
  $guid,
  $method 
)
protected

Send a notification to a subscriber.

Parameters
\Elgg\Notifications\Event$eventThe notification event
int$guidThe guid of the subscriber
string$methodThe notification method
Returns
bool private

Definition at line 247 of file NotificationsService.php.

Elgg\Notifications\NotificationsService::sendNotifications (   $event,
  $subscriptions 
)
protected

Sends the notifications based on subscriptions.

Parameters
\Elgg\Notifications\Event$eventNotification event
array$subscriptionsSubscriptions for this event
Returns
int The number of notifications handled private

Definition at line 219 of file NotificationsService.php.

Elgg\Notifications\NotificationsService::setDeprecatedNotificationSubject (   $type,
  $subtype,
  $subject 
)

Set message subject for deprecated notification code.

Parameters
string$typeEntity type
string$subtypeEntity subtype
string$subjectSubject line
Returns
void

Definition at line 382 of file NotificationsService.php.

Elgg\Notifications\NotificationsService::unregisterEvent (   $type,
  $subtype 
)
See also
elgg_unregister_notification_event() private

Definition at line 84 of file NotificationsService.php.

Elgg\Notifications\NotificationsService::unregisterMethod (   $name)
See also
elgg_unregister_notification_method() private

Definition at line 114 of file NotificationsService.php.

Member Data Documentation

Elgg\Notifications\NotificationsService::$deprHandlers = array()
protected

Definition at line 38 of file NotificationsService.php.

Elgg\Notifications\NotificationsService::$deprSubjects = array()
protected

Definition at line 41 of file NotificationsService.php.

Elgg\Notifications\NotificationsService::$events = array()
protected

Definition at line 32 of file NotificationsService.php.

Elgg\Notifications\NotificationsService::$hooks
protected

Definition at line 26 of file NotificationsService.php.

Elgg\Notifications\NotificationsService::$methods = array()
protected

Definition at line 35 of file NotificationsService.php.

Elgg\Notifications\NotificationsService::$queue
protected

Definition at line 23 of file NotificationsService.php.

Elgg\Notifications\NotificationsService::$session
protected

Definition at line 29 of file NotificationsService.php.

Elgg\Notifications\NotificationsService::$subscriptions
protected

Definition at line 20 of file NotificationsService.php.

const Elgg\Notifications\NotificationsService::QUEUE_NAME = 'notifications'

Definition at line 17 of file NotificationsService.php.


The documentation for this class was generated from the following file: