phpDocumentor Notification
Classes
[ class tree: Notification ] [ index: Notification ] [ all elements ]

Class: NotificationHelper

Source Location: /modules/notification/classes/NotificationHelper.class

Class NotificationHelper

Method Summary
array   getActiveNotificationsHandlers()   Retrieve the list of active notifications and hndlers registered for the specified event
array   getActiveSubscriptionsEvents()   Retrieve the active Gallery events that the active notification subscriptions depend on.
array   getDefinedEvents()   Get all the event notifications.
array   getDefinedHandlers()   Get all the notification handlers.
array   getEnabledNotifications()   Get the enable notifications.
array   getSubscriberByEntityId()   Get all the subscriptions for an item.
array   getSubscribers()   Get the subscribers that have permission for an event.
array   getSubscriptions()   Get the subscriptions for a user and optionally an itemId.
array   getUserIdCheck()   Check if the user is logged on.
GalleryStatus   removeHintFromListener()   When a subscription is removed, check that that the event listener is no longer required.
GalleryStatus   subscribe()   Subscribe the user to item/event combination with the specified handler.
GalleryStatus   unsubscribe()   Unsubscribe the user from the item/event combination.
GalleryStatus   _applySubscription()   Subscribe the user to item/event combination with the specified handler and optionally propagate the subscriptions to any existing children.
GalleryStatus   _applyUnsubscribe()   Unubscribe the user to item/event combination with the specified handler and optioanlly propagate the subscription removal to any existing descendents.
int   _lockHints()   Acquire the lock for the hints

[ Top ]
Methods
getActiveNotificationsHandlers  [line 256]

  array getActiveNotificationsHandlers( array $notificationEvents  )

Retrieve the list of active notifications and hndlers registered for the specified event

Parameters:
array   $notificationEvents:  Names of the Notification events to return.

API Tags:
Return:  array('notificationName' => array('handlerId', ...)


[ Top ]
getActiveSubscriptionsEvents  [line 223]

  array getActiveSubscriptionsEvents( )

Retrieve the active Gallery events that the active notification subscriptions depend on.


API Tags:
Return:  GalleryStatus array An array suitable for use as hints. (i.e. array(gallery event, ...))


[ Top ]
getDefinedEvents  [line 113]

  array getDefinedEvents( [boolean $display = false]  )

Get all the event notifications.

Parameters:
boolean   $display:  (optional) add display entry to the list. default: false

API Tags:
Return:  GalleryStatus array (event id => event description)


[ Top ]
getDefinedHandlers  [line 160]

  array getDefinedHandlers( [boolean $display = false]  )

Get all the notification handlers.

Parameters:
boolean   $display:  (optional) add display entry to the list. default: false

API Tags:
Return:  GalleryStatus array (handler id => handler description)


[ Top ]
getEnabledNotifications  [line 64]

  array getEnabledNotifications( [boolean $forUpdate = false]  )

Get the enable notifications.

Parameters:
boolean   $forUpdate:  (optional) Grab the write lock. (default is false)

API Tags:
Return:  GalleryStatus array An associative array of the enabled events and handlers ['Event Name']['handler'] => 'public' => 0|1) 'enabled' => 0|1) int the lock id


[ Top ]
getSubscriberByEntityId  [line 337]

  array getSubscriberByEntityId( int $itemId, int $userId  )

Get all the subscriptions for an item.

Parameters:
int   $userId:  User id to retrieve the subscription for
int   $itemId:  Item id to filter the subscriptions for

API Tags:
Return:  GalleryStatus a status code array Array of eventId => userid array


[ Top ]
getSubscribers  [line 286]

  array getSubscribers( string $notificationName, NotificationEvent_1_0 $notification  )

Get the subscribers that have permission for an event.

Parameters:
string   $notificationName: 
NotificationEvent_1_0   $notification: 

API Tags:
Return:  GalleryStatus a status code array Array of userid that are subscribed to the event for the specfied item


[ Top ]
getSubscriptions  [line 198]

  array getSubscriptions( int $userId, [mixed $itemId = null]  )

Get the subscriptions for a user and optionally an itemId.

Parameters:
int   $userId:  User id to retrieve the subscription for
mixed   $itemId:  (optional) array of itemids or single id to filter the subscriptions for

API Tags:
Return:  GalleryStatus a status code array (event name => 1)


[ Top ]
getUserIdCheck  [line 42]

  array getUserIdCheck( )

Check if the user is logged on.


API Tags:
Return:  GalleryStatus a status code integer UserId


[ Top ]
removeHintFromListener  [line 426]

  GalleryStatus removeHintFromListener( int $event  )

When a subscription is removed, check that that the event listener is no longer required.

Parameters:
int   $event:  The id of the event to be unsubscribed from


[ Top ]
subscribe  [line 486]

  GalleryStatus subscribe( int $userId, GalleryItem $item, string $eventName, string $notificationName, string $handler, boolean $recursive  )

Subscribe the user to item/event combination with the specified handler.

Parameters:
int   $userId:  The user id
GalleryItem   $item: 
string   $eventName:  The name of the event that is being subscribed to.
string   $notificationName:  The name of the notification to be subscribed to.
string   $handler:  The notification handler to be invoked
boolean   $recursive:  If not empty apply subscription to descendent items


[ Top ]
unsubscribe  [line 364]

  GalleryStatus unsubscribe( int $userId, int $itemId, string $eventName, string $notificationName, string $handler, boolean $recursive  )

Unsubscribe the user from the item/event combination.

Parameters:
int   $userId:  The user id
int   $itemId:  The item id
string   $eventName:  The name of the event that is being unsubscribed from.
string   $notificationName:  The notification definiftion name
string   $handler:  The notification handler name
boolean   $recursive:  If not empty apply subscription removal to descendent items


[ Top ]
_applySubscription  [line 557]

  GalleryStatus _applySubscription( int $userId, GalleryItem $item, string $name, string $notification, string $handler, boolean $recursive  )

Subscribe the user to item/event combination with the specified handler and optionally propagate the subscriptions to any existing children.

Parameters:
int   $userId:  The user id
GalleryItem   $item:  The item
string   $name:  The name of the notification to be subscribed to.
string   $notification:  The notification being subscribed to
string   $handler:  The notification handler to be invoked
boolean   $recursive:  If not empty apply subscription to descendent items


[ Top ]
_applyUnsubscribe  [line 385]

  GalleryStatus _applyUnsubscribe( int $userId, int $itemId, $eventName, string $name, string $handler, boolean $recursive, string $notification  )

Unubscribe the user to item/event combination with the specified handler and optioanlly propagate the subscription removal to any existing descendents.

Parameters:
int   $userId:  The user id
int   $itemId:  The item id
string   $name:  The name of the notification to be subscribed to.
string   $notification:  The notification being subscribed to
string   $handler:  The notification handler to be invoked
boolean   $recursive:  If not empty apply subscription to child items
   $eventName: 


[ Top ]
_lockHints  [line 633]

  int _lockHints( )

Acquire the lock for the hints


API Tags:
Return:  the lock id

Information Tags:
Private:  

[ Top ]

Documentation generated on Fri, 08 Oct 2010 05:42:23 -0700 by phpDocumentor 1.3.0RC6