manager
class manager
Notifications service class
Properties
protected array | $notification_types | ||
protected array | $subscription_types | ||
protected method_interface[] | $notification_methods | ||
protected ContainerInterface | $phpbb_container | ||
protected user_loader | $user_loader | ||
protected dispatcher_interface | $phpbb_dispatcher | ||
protected driver_interface | $db | ||
protected service | $cache | ||
protected language | $language | ||
protected user | $user | ||
protected string | $notification_types_table | ||
protected string | $user_notifications_table |
Methods
Notification Constructor
Load the user's notifications for a given method
Mark notifications read or unread for all available methods
Mark notifications read or unread for all available methods
Mark notifications read or unread from a parent identifier for all available methods
Mark notifications read or unread from a parent identifier for all available methods
Mark notifications read or unread for a given method
Add a notification
Add a notification for specific users
Update notification
Update a notification
Delete a notification
Get all of the subscription types
Get all of the subscription methods
Get user's notification data
Get global subscriptions (item_id = 0)
Add a subscription
Delete a subscription
Disable all notifications of a certain type
Purge all notifications of a certain type
Enable all notifications of a certain type
Delete all notifications older than a certain time
Helper to get the list of methods enabled by default
Helper to get the notifications item type class and set it up
Helper to get the notifications method class and set it up
Helper to load objects (notification types/methods)
Get the notification type id from the name
Get notification type ids (as an array)
Find the users which are already notified
Details
at line 74
__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 111
array
load_notifications(string $method_name, array $options = array())
Load the user's notifications for a given method
at line 143
mark_notifications_read(bool|string|array $notification_type_name, bool|int|array $item_id, bool|int|array $user_id, bool|int $time = false)
deprecated
deprecated
Mark notifications read or unread for all available methods
at line 157
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 189
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)
deprecated
deprecated
Mark notifications read or unread from a parent identifier for all available methods
at line 203
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 229
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 250
array
add_notifications(string|array $notification_type_name, array $data, array $options = array())
Add a notification
at line 332
add_notifications_for_users(string|array $notification_type_name, array $data, array $notify_users)
Add a notification for specific users
at line 439
update_notifications(string|array $notification_type_name, array $data, array $options = array())
Update notification
at line 461
update_notification(type_interface $notification, array $data, array $options = array())
Update a notification
at line 483
delete_notifications(string|array $notification_type_name, int|array $item_id, mixed $parent_id = false, mixed $user_id = false)
Delete a notification
at line 509
array
get_subscription_types()
Get all of the subscription types
at line 550
array
get_subscription_methods()
Get all of the subscription methods
at line 618
protected array
get_user_notifications(int $user_id)
Get user's notification data
at line 645
array
get_global_subscriptions(bool|int $user_id = false)
Get global subscriptions (item_id = 0)
at line 699
add_subscription(string $item_type, int $item_id = 0, string $method = null, bool|int $user_id = false)
Add a subscription
at line 755
delete_subscription(string $item_type, int $item_id = 0, string $method = null, bool|int $user_id = false)
Delete a subscription
at line 800
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 816
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 850
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 864
prune_notifications(int $timestamp, bool $only_read = true)
Delete all notifications older than a certain time
at line 878
method_interface[]
get_default_methods()
Helper to get the list of methods enabled by default
at line 900
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 915
method_interface
get_method_class(string $method_name)
Helper to get the notifications method class and set it up
at line 926
protected method_interface|type_interface
load_object(string $object_name)
Helper to load objects (notification types/methods)
at line 945
int
get_notification_type_id(string $notification_type_name)
Get the notification type id from the name
at line 987
array
get_notification_type_ids(string|array $notification_type_names)
Get notification type ids (as an array)
at line 1011
array
get_notified_users(bool|string|array $notification_type_name, array $options)
Find the users which are already notified