class manager
Notifications service class
Methods
manager |
__construct(array $notification_types, array $notification_methods, ContainerInterface $phpbb_container, user_loader $user_loader, dispatcher_interface $phpbb_dispatcher, driver_interface $db, service $cache, language $language, user $user, string $notification_types_table, string $user_notifications_table)
Notification Constructor |
|
array |
load_notifications(string $method_name, array $options = array())
Load the user's notifications for a given method |
|
mark_notifications_read(bool|string|array $notification_type_name, bool|int|array $item_id, bool|int|array $user_id, bool|int $time = false)
Mark notifications read or unread for all available methods |
||
mark_notifications(bool|string|array $notification_type_name, bool|int|array $item_id, bool|int|array $user_id, bool|int $time = false, bool $mark_read = true)
Mark notifications read or unread for all available methods |
||
mark_notifications_read_by_parent(string|array $notification_type_name, bool|int|array $item_parent_id, bool|int|array $user_id, bool|int $time = false)
Mark notifications read or unread from a parent identifier for all available methods |
||
mark_notifications_by_parent(string|array $notification_type_name, 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 for all available methods |
||
mark_notifications_by_id(string $method_name, int|array $notification_id, bool|int $time = false, bool $mark_read = true)
Mark notifications read or unread for a given method |
||
array |
add_notifications(string|array $notification_type_name, array $data, array $options = array())
Add a notification |
|
add_notifications_for_users(string|array $notification_type_name, array $data, array $notify_users)
Add a notification for specific users |
||
update_notifications(string|array $notification_type_name, array $data, array $options = array())
Update notification |
||
update_notification(type_interface $notification, array $data, array $options = array())
Update a notification |
||
delete_notifications(string|array $notification_type_name, int|array $item_id, mixed $parent_id = false, mixed $user_id = false)
Delete a notification |
||
array |
get_subscription_types()
Get all of the subscription types |
|
array |
get_subscription_methods()
Get all of the subscription methods |
|
array |
get_global_subscriptions(bool|int $user_id = false)
Get global subscriptions (item_id = 0) |
|
add_subscription(string $item_type, int $item_id, string $method = null, bool|int $user_id = false)
Add a subscription |
||
delete_subscription(string $item_type, int $item_id, string $method = null, bool|int $user_id = false)
Delete a subscription |
||
disable_notifications(string $notification_type_name)
Disable all notifications of a certain type |
||
purge_notifications(string $notification_type_name)
Purge all notifications of a certain type |
||
enable_notifications(string $notification_type_name)
Enable all notifications of a certain type |
||
prune_notifications(int $timestamp, bool $only_read = true)
Delete all notifications older than a certain time |
||
method_interface[] |
get_default_methods()
Helper to get the list of methods enabled by default |
|
type_interface |
get_item_type_class(string $notification_type_name, array $data = array())
Helper to get the notifications item type class and set it up |
|
method_interface |
get_method_class(string $method_name)
Helper to get the notifications method class and set it up |
|
int |
get_notification_type_id(string $notification_type_name)
Get the notification type id from the name |
|
array |
get_notification_type_ids(string|array $notification_type_names)
Get notification type ids (as an array) |
|
array |
get_notified_users(bool|string|array $notification_type_name, array $options)
Find the users which are already notified |
Details
at line 76
public manager
__construct(array $notification_types, array $notification_methods, ContainerInterface $phpbb_container, user_loader $user_loader, dispatcher_interface $phpbb_dispatcher, driver_interface $db, service $cache, language $language, user $user, string $notification_types_table, string $user_notifications_table)
Notification Constructor
at line 113
public array
load_notifications(string $method_name, array $options = array())
Load the user's notifications for a given method
at line 145
public
mark_notifications_read(bool|string|array $notification_type_name, bool|int|array $item_id, bool|int|array $user_id, bool|int $time = false)
Mark notifications read or unread for all available methods
at line 159
public
mark_notifications(bool|string|array $notification_type_name, bool|int|array $item_id, bool|int|array $user_id, bool|int $time = false, bool $mark_read = true)
Mark notifications read or unread for all available methods
at line 191
public
mark_notifications_read_by_parent(string|array $notification_type_name, bool|int|array $item_parent_id, bool|int|array $user_id, bool|int $time = false)
Mark notifications read or unread from a parent identifier for all available methods
at line 205
public
mark_notifications_by_parent(string|array $notification_type_name, 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 for all available methods
at line 231
public
mark_notifications_by_id(string $method_name, int|array $notification_id, bool|int $time = false, bool $mark_read = true)
Mark notifications read or unread for a given method
at line 252
public array
add_notifications(string|array $notification_type_name, array $data, array $options = array())
Add a notification
at line 307
public
add_notifications_for_users(string|array $notification_type_name, array $data, array $notify_users)
Add a notification for specific users
at line 414
public
update_notifications(string|array $notification_type_name, array $data, array $options = array())
Update notification
at line 436
public
update_notification(type_interface $notification, array $data, array $options = array())
Update a notification
at line 458
public
delete_notifications(string|array $notification_type_name, int|array $item_id, mixed $parent_id = false, mixed $user_id = false)
Delete a notification
at line 484
public array
get_subscription_types()
Get all of the subscription types
at line 525
public array
get_subscription_methods()
Get all of the subscription methods
at line 620
public array
get_global_subscriptions(bool|int $user_id = false)
Get global subscriptions (item_id = 0)
at line 674
public
add_subscription(string $item_type, int $item_id, string $method = null, bool|int $user_id = false)
Add a subscription
at line 730
public
delete_subscription(string $item_type, int $item_id, string $method = null, bool|int $user_id = false)
Delete a subscription
at line 775
public
disable_notifications(string $notification_type_name)
Disable all notifications of a certain type
This should be called when an extension which has notification types is disabled so that all those notifications are hidden and do not cause errors
at line 791
public
purge_notifications(string $notification_type_name)
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
at line 825
public
enable_notifications(string $notification_type_name)
Enable all notifications of a certain type
This should be called when an extension which has notification types that was disabled is re-enabled so that all those notifications that were hidden are shown again
at line 839
public
prune_notifications(int $timestamp, bool $only_read = true)
Delete all notifications older than a certain time
at line 853
public method_interface[]
get_default_methods()
Helper to get the list of methods enabled by default
at line 875
public type_interface
get_item_type_class(string $notification_type_name, array $data = array())
Helper to get the notifications item type class and set it up
at line 890
public method_interface
get_method_class(string $method_name)
Helper to get the notifications method class and set it up
at line 920
public int
get_notification_type_id(string $notification_type_name)
Get the notification type id from the name
at line 960
public array
get_notification_type_ids(string|array $notification_type_names)
Get notification type ids (as an array)
at line 984
public array
get_notified_users(bool|string|array $notification_type_name, array $options)
Find the users which are already notified