API - XOOPS 2.5.11 Beta 2
By monxoops.fr
XoopsNotificationHandler Class Reference
Inheritance diagram for XoopsNotificationHandler:
Collaboration diagram for XoopsNotificationHandler:

Public Member Functions

 create ($isNew=true)
 
 get ($id)
 
 insert (XoopsObject $notification)
 
 delete (XoopsObject $notification)
 
 getObjects (CriteriaElement $criteria=null, $id_as_key=false)
 
 getCount (CriteriaElement $criteria=null)
 
 deleteAll (CriteriaElement $criteria=null)
 
getNotification ($module_id, $category, $item_id, $event, $user_id)
 
 isSubscribed ($category, $item_id, $event, $module_id, $user_id)
 
 subscribe ($category, $item_id, $events, $mode=null, $module_id=null, $user_id=null)
 
 getByUser ($user_id)
 
 getSubscribedEvents ($category, $item_id, $module_id, $user_id)
 
 getByItemId ($module_id, $item_id, $order=null, $mode=null)
 
 triggerEvents ($category, $item_id, $events, $extra_tags=array(), $user_list=array(), $module_id=null, $omit_user_id=null)
 
 triggerEvent ($category, $item_id, $event, $extra_tags=array(), $user_list=array(), $module_id=null, $omit_user_id=null)
 
 unsubscribeByUser ($user_id)
 
 unsubscribe ($category, $item_id, $events, $module_id=null, $user_id=null)
 
 unsubscribeByModule ($module_id)
 
 unsubscribeByItem ($module_id, $category, $item_id)
 
 doLoginMaintenance ($user_id)
 
 updateByField (XoopsNotification $notification, $field_name, $field_value)
 
- Public Member Functions inherited from XoopsObjectHandler
 __construct (XoopsDatabase $db)
 
 XoopsObjectHandler ($db)
 
 create ()
 
 get ($id)
 
 insert (XoopsObject $object)
 
 delete (XoopsObject $object)
 

Additional Inherited Members

- Data Fields inherited from XoopsObjectHandler
 $db
 

Member Function Documentation

◆ create()

create (   $isNew = true)

Create a XoopsNotification

Parameters
bool$isNewFlag the object as "new"?
Returns
XoopsNotification

◆ delete()

delete ( XoopsObject  $notification)

Delete a XoopsNotification from the database

Parameters
XoopsObject | XoopsNotification$notificationa XoopsNotification object
Returns
bool true on success, otherwise false

Reimplemented from XoopsObjectHandler.

◆ deleteAll()

deleteAll ( CriteriaElement  $criteria = null)

Delete multiple notifications

Parameters
CriteriaElement | CriteriaCompo$criteriaCriteriaElement
Returns
bool
Here is the caller graph for this function:

◆ doLoginMaintenance()

doLoginMaintenance (   $user_id)

Perform notification maintenance activites at login time. In particular, any notifications for the newly logged-in user with mode XOOPS_NOTIFICATION_MODE_WAITFORLOGIN are switched to mode XOOPS_NOTIFICATION_MODE_SENDONCETHENWAIT.

Parameters
int$user_idID of the user being logged in
Here is the call graph for this function:

◆ get()

get (   $id)

Retrieve a XoopsNotification

Parameters
int$idID
Returns
XoopsNotification XoopsNotification, FALSE on fail

Reimplemented from XoopsObjectHandler.

◆ getByItemId()

getByItemId (   $module_id,
  $item_id,
  $order = null,
  $mode = null 
)

Retrieve items by their ID

Parameters
int$module_idModule ID
int$item_idItem ID
string$orderSort order
int$modenot_mode see include/notification_constants.php
null$status
Returns
array Array of XoopsNotification objects
Here is the call graph for this function:

◆ getByUser()

getByUser (   $user_id)

Get a list of notifications by user ID

Parameters
int$user_idID of the user
Returns
array Array of XoopsNotification objects
Here is the call graph for this function:

◆ getCount()

getCount ( CriteriaElement  $criteria = null)

Count Notifications

Parameters
CriteriaElement | CriteriaCompo$criteriaCriteriaElement
Returns
int Count
Here is the caller graph for this function:

◆ getNotification()

& getNotification (   $module_id,
  $category,
  $item_id,
  $event,
  $user_id 
)
Parameters
$module_id
$category
$item_id
$event
$user_id
Returns
bool
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getObjects()

getObjects ( CriteriaElement  $criteria = null,
  $id_as_key = false 
)

Get some XoopsNotifications

Parameters
CriteriaElement | CriteriaCompo$criteria
bool$id_as_keyUse IDs as keys into the array?
Returns
array Array of XoopsNotification objects
Here is the caller graph for this function:

◆ getSubscribedEvents()

getSubscribedEvents (   $category,
  $item_id,
  $module_id,
  $user_id 
)

Get a list of notification events for the current item/mod/user

Parameters
$category
$item_id
$module_id
$user_id
Returns
array
Here is the call graph for this function:

◆ insert()

insert ( XoopsObject  $notification)

Write a notification(subscription) to database

Parameters
XoopsObject | XoopsNotification$notificationa XoopsNotification object
Returns
bool true on success, otherwise false

Reimplemented from XoopsObjectHandler.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isSubscribed()

isSubscribed (   $category,
  $item_id,
  $event,
  $module_id,
  $user_id 
)

Determine if a user is subscribed to a particular event in a particular module.

Parameters
string$categoryCategory of notification event
int$item_idItem ID of notification event
string$eventEvent
int$module_idID of module (default current module)
int$user_idID of user (default current user) return int 0 if not subscribe; non-zero if subscribed
Returns
int
Here is the call graph for this function:

◆ subscribe()

subscribe (   $category,
  $item_id,
  $events,
  $mode = null,
  $module_id = null,
  $user_id = null 
)

Subscribe for notification for an event(s)

Parameters
string$categorycategory of notification
int$item_idID of the item
mixed$eventsevent string or array of events
int$modeforce a particular notification mode (e.g. once_only) (default to current user preference)
int$module_idID of the module (default to current module)
int$user_idID of the user (default to current user)
Returns
bool
Here is the call graph for this function:

◆ triggerEvent()

triggerEvent (   $category,
  $item_id,
  $event,
  $extra_tags = array(),
  $user_list = array(),
  $module_id = null,
  $omit_user_id = null 
)

Trigger a single notification event

Parameters
string$category
int$item_id
string$event
array$extra_tags
array$user_list
int$module_id
int$omit_user_id
Returns
mixed
Here is the call graph for this function:
Here is the caller graph for this function:

◆ triggerEvents()

triggerEvents (   $category,
  $item_id,
  $events,
  $extra_tags = array(),
  $user_list = array(),
  $module_id = null,
  $omit_user_id = null 
)

Send notifications to users

Parameters
string$categorynotification category
int$item_idID of the item
array$eventstrigger events
array$extra_tagsarray of substitutions for template to be merged with the one from function..
array$user_listonly notify the selected users
int$module_idID of the module
int$omit_user_idID of the user to omit from notifications. (default to current user). set to 0 for all users to receive notification.
Here is the call graph for this function:

◆ unsubscribe()

unsubscribe (   $category,
  $item_id,
  $events,
  $module_id = null,
  $user_id = null 
)

Unsubscribe notifications for an event(s).

Parameters
string$categorycategory of the events
int$item_idID of the item
mixed$eventsevent string or array of events
int$module_idID of the module (default current module)
int$user_idUID of the user (default current user)
Returns
bool
Here is the call graph for this function:

◆ unsubscribeByItem()

unsubscribeByItem (   $module_id,
  $category,
  $item_id 
)

Delete all subscriptions for a particular item.

Parameters
int$module_idID of the module to which item belongs
string$categoryNotification category of the item
int$item_idID of the item
Returns
bool
Here is the call graph for this function:

◆ unsubscribeByModule()

unsubscribeByModule (   $module_id)

Delete all notifications for a particular module

Parameters
int$module_idID of the module
Returns
bool
Here is the call graph for this function:

◆ unsubscribeByUser()

unsubscribeByUser (   $user_id)

Delete all notifications for one user

Parameters
int$user_idID of the user
Returns
bool
Here is the call graph for this function:

◆ updateByField()

updateByField ( XoopsNotification  $notification,
  $field_name,
  $field_value 
)

Update

Parameters
XoopsNotification$notificationXoopsNotification object
string$field_nameName of the field
mixed$field_valueValue to write
Returns
bool
Here is the call graph for this function:
Here is the caller graph for this function:

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