Methods summary
public
object
&
|
|
public
object
&
|
|
public
boolean
|
#
insert( object & $notification )
Inserts a notification(subscription) into database
Inserts a notification(subscription) into database
Parameters
- $notification
- $notification
Returns
boolean
|
public
boolean
|
|
public
array
|
#
getObjects( object $criteria = null, boolean $id_as_key = false )
|
public
integer
|
#
getCount( object $criteria = null )
Count Notifications
Parameters
Returns
integer Count
|
public
boolean
|
#
deleteAll( object $criteria = null )
Delete multiple notifications
Delete multiple notifications
Parameters
Returns
boolean
|
public
mixed
&
|
#
getNotification( integer $module_id, string $category, integer $item_id, string $event, integer $user_id )
Change a value in multiple notifications
Change a value in multiple notifications
Parameters
- $module_id
- module ID to get notification for
- $category
- category to get notification for
- $item_id
- item ID to get notification for
- $event
- module ID to get notification for
- $user_id
- user ID to get notification for
Returns
mixed array of objects or false
|
public
|
#
isSubscribed( string $category, integer $item_id, string $event, integer $module_id, integer $user_id )
Determine if a user is subscribed to a particular event in
a particular module.
Determine if a user is subscribed to a particular event in
a particular module.
Parameters
- $category
- Category of notification event
- $item_id
- Item ID of notification event
- $event
- Event
- $module_id
- ID of module (default current module)
- $user_id
ID of user (default current user)
return int 0 if not subscribe; non-zero if subscribed (boolean... sort of)
|
public
|
#
subscribe( string $category, integer $item_id, mixed $events, integer $mode = null, integer $module_id = null, integer $user_id = null )
Subscribe for notification for an event(s)
Subscribe for notification for an event(s)
Parameters
- $category
- category of notification
- $item_id
- ID of the item
- $events
- event string or array of events
- $mode
force a particular notification mode
(e.g. once_only) (default to current user preference)
- $module_id
- ID of the module (default to current module)
- $user_id
- ID of the user (default to current user)
|
public
array
|
#
getByUser( integer $user_id )
Get a list of notifications by user ID
Get a list of notifications by user ID
Parameters
Returns
|
public
array
|
#
getSubscribedEvents( string $category, integer $item_id, integer $module_id, integer $user_id )
Get a list of notification events for the current item/mod/user
Get a list of notification events for the current item/mod/user
Parameters
- $category
- category for the subscribed events
- $item_id
- ID of the subscribed items
- $module_id
- ID of the module of the subscribed items
- $user_id
- ID of the user of the subscribed items
Returns
|
public
array
|
#
getByItemId( integer $module_id, integer $item_id, string $order = null, string $status = null )
Retrieve items by their ID
Retrieve items by their ID
Parameters
- $module_id
- Module ID
- $item_id
- Item ID
- $order
- Sort order
- $status
- status
Returns
|
public
|
#
triggerEvents( $category, $item_id, $events, $extra_tags = array(), $user_list = array(), $module_id = null, $omit_user_id = null )
|
public
|
#
triggerEvent( string $category, integer $item_id, string $event, array $extra_tags = array(), array $user_list = array(), integer $module_id = null, integer $omit_user_id = null )
Send notifications to users
Send notifications to users
Parameters
- $category
- notification category
- $item_id
- ID of the item
- $event
- notification event
- $extra_tags
array of substitutions for template to be
merged with the one from function..
- $user_list
- only notify the selected users
- $module_id
- ID of the module
- $omit_user_id
- ID of the user to omit from notifications. (default to current user). set to 0 for all users to receive notification.
|
public
boolean
|
#
unsubscribeByUser( integer $user_id )
Delete all notifications for one user
Delete all notifications for one user
Parameters
Returns
boolean
|
public
boolean
|
#
unsubscribe( string $category, integer $item_id, mixed $events, integer $module_id = null, integer $user_id = null )
Unsubscribe notifications for an event(s).
Unsubscribe notifications for an event(s).
Parameters
- $category
- category of the events
- $item_id
- ID of the item
- $events
- event string or array of events
- $module_id
- ID of the module (default current module)
- $user_id
- UID of the user (default current user)
Returns
boolean
|
public
boolean
|
#
unsubscribeByModule( integer $module_id )
Delete all notifications for a particular module
Delete all notifications for a particular module
Parameters
- $module_id
- ID of the module
Returns
boolean
|
public
boolean
|
#
unsubscribeByItem( integer $module_id, string $category, integer $item_id )
Delete all subscriptions for a particular item.
Delete all subscriptions for a particular item.
Parameters
- $module_id
- ID of the module to which item belongs
- $category
- Notification category of the item
- $item_id
- ID of the item
Returns
boolean
|
public
|
#
doLoginMaintenance( integer $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.
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
- $user_id
- ID of the user being logged in
|
public
boolean
|
#
updateByField( object & $notification, string $field_name, mixed $field_value )
Update
Parameters
Returns
boolean
|
public static
boolean
|
#
isEnabled( string $style, integer $module_id = null )
Determine if notification is enabled for the selected module.
Determine if notification is enabled for the selected module.
Replaces function notificationEnabled()
Parameters
- $style
- Subscription style: 'block' or 'inline'
- $module_id
- ID of the module (default current module)
Returns
boolean
|
public static
mixed
&
|
#
categoryInfo( string $category_name = '', integer $module_id = null )
Replaces function ¬ificationCategoryInfo()
Replaces function ¬ificationCategoryInfo()
Get an associative array of info for a particular notification
category in the selected module. If no category is selected,
return an array of info for all categories.
Parameters
- $category_name
- $name Category name (default all categories)
- $module_id
- ID of the module (default current module)
Returns
mixed
|
public static
mixed
&
|
#
categoryEvents( string $category_name, boolean $enabled_only, integer $module_id = null )
Replaces function ¬ificationEvents()
Replaces function ¬ificationEvents()
Get an array of info for all events (each event has associative array)
in the selected category of the selected module.
Parameters
- $category_name
- Category name
- $enabled_only
- If true, return only enabled events
- $module_id
- ID of the module (default current module)
Returns
mixed
|
public static
boolean
|
#
eventEnabled( array & $category, array & $event, object & $module )
Replaces function notificationEventEnabled()
Replaces function notificationEventEnabled()
Determine whether a particular notification event is enabled.
Depends on module config options.
Parameters
- $category
- Category info array
- $event
- Event info array
- $module
- Module
Returns
boolean
|
public static
mixed
&
|
#
eventInfo( string $category_name, string $event_name, integer $module_id = null )
Replaces function ¬ificationEventInfo()
Replaces function ¬ificationEventInfo()
Get associative array of info for the selected event in the selected
category (for the selected module).
Parameters
- $category_name
- Notification category
- $event_name
- Notification event
- $module_id
- ID of the module (default current module)
Returns
mixed
|
public static
mixed
&
|
#
subscribableCategoryInfo( integer $module_id = null )
Replaces function ¬ificationSubscribableCategoryInfo()
Replaces function ¬ificationSubscribableCategoryInfo()
Get an array of associative info arrays for subscribable categories
for the selected module.
Parameters
- $module_id
- ID of the module
Returns
mixed
|
public static
|
#
generateConfig( array & $category, array & $event, string $type )
Replaces function notificationGenerateConfig()
Replaces function notificationGenerateConfig()
Generate module config info for a particular category, event pair.
The selectable config options are given names depending on the
category and event names, and the text depends on the category
and event titles. These are pieced together in this function in
case we wish to alter the syntax.
Parameters
- $category
- Array of category info
- $event
- Array of event info
- $type
The particular name to generate
return string
|