XOOPS 2.5.6  Final
 All Classes Namespaces Files Functions Variables Pages
XoopsNotificationHandler Class Reference
Inheritance diagram for XoopsNotificationHandler:
Inheritance graph

Public Member Functions

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

Additional Inherited Members

- Public Attributes inherited from XoopsObjectHandler
 $db
 

Detailed Description

Definition at line 210 of file notification.php.

Member Function Documentation

& XoopsNotificationHandler::create (   $isNew = true)

Create a XoopsNotification

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

Definition at line 219 of file notification.php.

XoopsNotificationHandler::delete ( $notification)

Delete a XoopsNotification from the database

Parameters
object&$notification
Returns
bool

: Change to if (!(class_exists($this->className) && $obj instanceof $this->className)) when going fully PHP5

Definition at line 300 of file notification.php.

References $result, and $sql.

XoopsNotificationHandler::deleteAll (   $criteria = null)

Delete multiple notifications

Parameters
object$criteriaCriteriaElement
Returns
bool

Definition at line 381 of file notification.php.

References $criteria, $result, and $sql.

Referenced by unsubscribe(), unsubscribeByItem(), unsubscribeByModule(), and unsubscribeByUser().

Here is the caller graph for this function:

XoopsNotificationHandler::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

Definition at line 796 of file notification.php.

References $criteria, $user_id, getObjects(), insert(), XOOPS_NOTIFICATION_MODE_SENDONCETHENWAIT, and XOOPS_NOTIFICATION_MODE_WAITFORLOGIN.

Here is the call graph for this function:

& XoopsNotificationHandler::get (   $id)

Retrieve a XoopsNotification

Parameters
int$idID
Returns
object XoopsNotification, FALSE on fail

Definition at line 235 of file notification.php.

References $result, and $sql.

XoopsNotificationHandler::getByItemId (   $module_id,
  $item_id,
  $order = null,
  $status = null 
)

Retrieve items by their ID

Parameters
int$module_idModule ID
int$item_idItem ID
string$orderSort order
Returns
array Array of XoopsNotification objects

Definition at line 539 of file notification.php.

References $criteria, $module_id, $status, and getObjects().

Here is the call graph for this function:

XoopsNotificationHandler::getByUser (   $user_id)

Get a list of notifications by user ID

Parameters
int$user_idID of the user
Returns
array Array of XoopsNotification objects

Definition at line 501 of file notification.php.

References $criteria, $user_id, and getObjects().

Here is the call graph for this function:

XoopsNotificationHandler::getCount (   $criteria = null)

Count Notifications

Parameters
object$criteriaCriteriaElement
Returns
int Count

Definition at line 361 of file notification.php.

References $criteria, $result, and $sql.

Referenced by isSubscribed().

Here is the caller graph for this function:

& XoopsNotificationHandler::getNotification (   $module_id,
  $category,
  $item_id,
  $event,
  $user_id 
)

Definition at line 395 of file notification.php.

References $criteria, $module_id, $user_id, and getObjects().

Referenced by subscribe().

Here is the call graph for this function:

Here is the caller graph for this function:

XoopsNotificationHandler::getObjects (   $criteria = null,
  $id_as_key = false 
)

Get some XoopsNotifications

Parameters
object$criteria
bool$id_as_keyUse IDs as keys into the array?
Returns
array Array of XoopsNotification objects

Definition at line 324 of file notification.php.

References $criteria, $limit, $result, $ret, $sql, and $start.

Referenced by doLoginMaintenance(), getByItemId(), getByUser(), getNotification(), getSubscribedEvents(), and triggerEvent().

Here is the caller graph for this function:

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

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

Definition at line 512 of file notification.php.

References $criteria, $i, $module_id, $ret, $user_id, and getObjects().

Here is the call graph for this function:

XoopsNotificationHandler::insert ( $notification)

Write a notification(subscription) to database

Parameters
object&$notification
Returns
bool

: Change to if (!(class_exists($this->className) && $obj instanceof $this->className)) when going fully PHP5

Definition at line 260 of file notification.php.

References $result, and $sql.

Referenced by doLoginMaintenance(), subscribe(), and updateByField().

Here is the caller graph for this function:

XoopsNotificationHandler::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

Definition at line 422 of file notification.php.

References $criteria, $module_id, $user_id, and getCount().

Here is the call graph for this function:

XoopsNotificationHandler::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)

Definition at line 448 of file notification.php.

References $module_id, $user, $user_id, $xoopsModule, $xoopsUser, XoopsObjectHandler\create(), getNotification(), insert(), and updateByField().

Here is the call graph for this function:

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

Enter description here...

Parameters
int$category
int$item_id
int$event
array$extra_tags
array$user_list
int$module_id
int$omit_user_id
Returns
unknown

Definition at line 592 of file notification.php.

References $config_handler, $criteria, $GLOBALS, $module, $module_handler, $module_id, $user, $xoopsModule, $xoopsUser, _NOT_ITEMNAMENOTAVAILABLE, _NOT_ITEMTYPENOTAVAILABLE, _NOT_ITEMURLNOTAVAILABLE, getObjects(), notificationCategoryInfo(), notificationEventInfo(), notificationGenerateConfig(), xoops_gethandler(), XOOPS_NOTIFICATION_MODE_SENDALWAYS, XOOPS_NOTIFICATION_MODE_SENDONCETHENDELETE, and XOOPS_NOTIFICATION_MODE_SENDONCETHENWAIT.

Referenced by triggerEvents().

Here is the call graph for this function:

Here is the caller graph for this function:

XoopsNotificationHandler::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
string$eventnotification event
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.

Definition at line 570 of file notification.php.

References $module_id, and triggerEvent().

Here is the call graph for this function:

XoopsNotificationHandler::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

Definition at line 725 of file notification.php.

References $criteria, $module_id, $user_id, $xoopsModule, $xoopsUser, and deleteAll().

Here is the call graph for this function:

XoopsNotificationHandler::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

Definition at line 779 of file notification.php.

References $criteria, $module_id, and deleteAll().

Here is the call graph for this function:

XoopsNotificationHandler::unsubscribeByModule (   $module_id)

Delete all notifications for a particular module

Parameters
int$module_idID of the module
Returns
bool

Definition at line 764 of file notification.php.

References $criteria, $module_id, and deleteAll().

Here is the call graph for this function:

XoopsNotificationHandler::unsubscribeByUser (   $user_id)

Delete all notifications for one user

Parameters
int$user_idID of the user
Returns
bool

Definition at line 707 of file notification.php.

References $criteria, $user_id, and deleteAll().

Here is the call graph for this function:

XoopsNotificationHandler::updateByField ( $notification,
  $field_name,
  $field_value 
)

Update

Parameters
object&$notificationXoopsNotification object
string$field_nameName of the field
mixed$field_valueValue to write
Returns
bool

Definition at line 818 of file notification.php.

References insert().

Referenced by subscribe().

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: