Elgg  Version 1.9
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, Elgg_Access $access)
 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
 
 $access
 
 $events = array()
 
 $methods = array()
 
 $deprHandlers = array()
 
 $deprSubjects = array()
 

Detailed Description

Definition at line 12 of file NotificationsService.php.

Constructor & Destructor Documentation

Elgg_Notifications_NotificationsService::__construct ( Elgg_Notifications_SubscriptionsService  $subscriptions,
Elgg_Queue_Queue  $queue,
Elgg_PluginHooksService  $hooks,
Elgg_Access  $access 
)

Constructor.

Parameters
Elgg_Notifications_SubscriptionsService$subscriptionsSubscription service
Elgg_Queue_Queue$queueQueue
Elgg_PluginHooksService$hooksPlugin hook service
Elgg_Access$accessAccess control service

Definition at line 48 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 135 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 426 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 322 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
Elgg_Notifications_Notification

Definition at line 352 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 401 of file NotificationsService.php.

Elgg_Notifications_NotificationsService::getEvents ( )

private

Definition at line 95 of file NotificationsService.php.

Elgg_Notifications_NotificationsService::getMethods ( )

private

Definition at line 122 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 336 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 168 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 312 of file NotificationsService.php.

Elgg_Notifications_NotificationsService::registerEvent (   $type,
  $subtype,
array  $actions = array() 
)
See also
elgg_register_notification_event() private

Definition at line 60 of file NotificationsService.php.

Elgg_Notifications_NotificationsService::registerMethod (   $name)
See also
elgg_register_notification_method() private

Definition at line 103 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 244 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 216 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 379 of file NotificationsService.php.

Elgg_Notifications_NotificationsService::unregisterEvent (   $type,
  $subtype 
)
See also
elgg_unregister_notification_event() private

Definition at line 81 of file NotificationsService.php.

Elgg_Notifications_NotificationsService::unregisterMethod (   $name)
See also
elgg_unregister_notification_method() private

Definition at line 111 of file NotificationsService.php.

Member Data Documentation

Elgg_Notifications_NotificationsService::$access
protected

Definition at line 26 of file NotificationsService.php.

Elgg_Notifications_NotificationsService::$deprHandlers = array()
protected

Definition at line 35 of file NotificationsService.php.

Elgg_Notifications_NotificationsService::$deprSubjects = array()
protected

Definition at line 38 of file NotificationsService.php.

Elgg_Notifications_NotificationsService::$events = array()
protected

Definition at line 29 of file NotificationsService.php.

Elgg_Notifications_NotificationsService::$hooks
protected

Definition at line 23 of file NotificationsService.php.

Elgg_Notifications_NotificationsService::$methods = array()
protected

Definition at line 32 of file NotificationsService.php.

Elgg_Notifications_NotificationsService::$queue
protected

Definition at line 20 of file NotificationsService.php.

Elgg_Notifications_NotificationsService::$subscriptions
protected

Definition at line 17 of file NotificationsService.php.

const Elgg_Notifications_NotificationsService::QUEUE_NAME = 'notifications'

Definition at line 14 of file NotificationsService.php.


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