interface method_interface
Base notifications method interface
Methods
string |
get_type()
Get notification method name |
|
bool |
is_enabled_by_default()
Is the method enable by default? |
|
is_available()
Is this method available for the user? This is checked on the notifications options |
||
array |
get_notified_users(int $notification_type_id, array $options)
Return the list of the users already notified |
|
array |
load_notifications(array $options = array())
Load the user's notifications |
|
add_to_queue(type_interface $notification)
Add a notification to the queue |
||
notify()
Parse the queue and notify the users |
||
update_notification(type_interface $notification, array $data, array $options)
Update a notification |
||
mark_notifications(bool|string $notification_type_id, bool|int|array $item_id, bool|int|array $user_id, bool|int $time = false, bool $mark_read = true)
Mark notifications read or unread |
||
mark_notifications_by_parent(string $notification_type_id, bool|int|array $item_parent_id, bool|int|array $user_id, bool|int $time = false, bool $mark_read = true)
Mark notifications read or unread from a parent identifier |
||
mark_notifications_by_id(int $notification_id, bool|int $time = false, bool $mark_read = true)
Mark notifications read or unread |
||
delete_notifications(string $notification_type_id, int|array $item_id, mixed $parent_id = false, mixed $user_id = false)
Delete a notification |
||
prune_notifications(int $timestamp, bool $only_read = true)
Delete all notifications older than a certain time |
||
purge_notifications(string $notification_type_id)
Purge all notifications of a certain type |
Details
at line 26
public string
get_type()
Get notification method name
at line 33
public bool
is_enabled_by_default()
Is the method enable by default?
at line 39
public
is_available()
Is this method available for the user? This is checked on the notifications options
at line 48
public array
get_notified_users(int $notification_type_id, array $options)
Return the list of the users already notified
at line 68
public array
load_notifications(array $options = array())
Load the user's notifications
at line 75
public
add_to_queue(type_interface $notification)
Add a notification to the queue
at line 80
public
notify()
Parse the queue and notify the users
at line 89
public
update_notification(type_interface $notification, array $data, array $options)
Update a notification
at line 100
public
mark_notifications(bool|string $notification_type_id, bool|int|array $item_id, bool|int|array $user_id, bool|int $time = false, bool $mark_read = true)
Mark notifications read or unread
at line 111
public
mark_notifications_by_parent(string $notification_type_id, bool|int|array $item_parent_id, bool|int|array $user_id, bool|int $time = false, bool $mark_read = true)
Mark notifications read or unread from a parent identifier
at line 120
public
mark_notifications_by_id(int $notification_id, bool|int $time = false, bool $mark_read = true)
Mark notifications read or unread
at line 130
public
delete_notifications(string $notification_type_id, int|array $item_id, mixed $parent_id = false, mixed $user_id = false)
Delete a notification
at line 138
public
prune_notifications(int $timestamp, bool $only_read = true)
Delete all notifications older than a certain time
at line 148
public
purge_notifications(string $notification_type_id)
Purge all notifications of a certain type
This should be called when an extension which has notification types is purged so that all those notifications are removed