Base class for notification hooks. Provides default implementations for all methods that provide full access to everyone, and interact with enabled table.
package | core_notifications |
---|
allowed_settings(\ID_TEXT $notification_code) : integer
\ID_TEXT
Notification code
integer
Allowed settingscreate_category_tree(\ID_TEXT $notification_code, \?ID_TEXT $id) : array
\ID_TEXT
Notification code
\?ID_TEXT
The ID of where we're looking under (null: N/A)
array
Tree structureget_default_auto_setting(\ID_TEXT $notification_code, \?SHORT_TEXT $category = null
) : integer
\ID_TEXT
Notification code
\?SHORT_TEXT
The category within the notification code (null: none)
integer
Automatic settingget_initial_setting(\ID_TEXT $notification_code, \?SHORT_TEXT $category = null
) : integer
\ID_TEXT
Notification code
\?SHORT_TEXT
The category within the notification code (null: none)
integer
Initial settinglist_handled_codes() : array
(Addons can define hooks that handle whole sets of codes, so hooks are written so they can take wide authority)
array
List of codes (mapping between code names, and a pair: section and labelling for those codes)list_members_who_have_enabled(\ID_TEXT $notification_code, \?SHORT_TEXT $category= null
, \?array $to_member_ids= null
, integer $start= 0
, integer $max= 300
) : array
\ID_TEXT
Notification code
\?SHORT_TEXT
The category within the notification code (null: none)
\?array
List of member IDs we are restricting to (null: no restriction). This effectively works as a intersection set operator against those who have enabled.
integer
Start position (for pagination)
integer
Maximum (for pagination)
array
A pair: Map of members to their notification setting, and whether there may be moremember_could_potentially_enable(\ID_TEXT $notification_code, \MEMBER $member_id, \?SHORT_TEXT $category = null
) : boolean
\ID_TEXT
Notification code
\MEMBER
Member to check against
\?SHORT_TEXT
The category within the notification code (null: none)
boolean
Whether they couldmember_has_enabled(\ID_TEXT $notification_code, \MEMBER $member_id, \?SHORT_TEXT $category = null
) : boolean
(Separate implementation to list_members_who_have_enabled, for performance reasons.)
\ID_TEXT
Notification code
\MEMBER
Member to check against
\?SHORT_TEXT
The category within the notification code (null: none)
boolean
Whether they havesupports_categories(\ID_TEXT $notification_code) : boolean
(Content types, for example, will define notifications on specific categories, not just in general. The categories are interpreted by the hook and may be complex. E.g. it might be like a regexp match, or like FORUM:3 or TOPIC:100)
\ID_TEXT
Notification code
boolean
Whether it does_all_members_who_have_enabled(\ID_TEXT $only_if_enabled_on__notification_code, \?SHORT_TEXT $only_if_enabled_on__category, \?array $to_member_ids, integer $start, integer $max, boolean $catch_all_too = true
) : array
(No pagination supported, as assumed there are only a small set of members here.)
\ID_TEXT
Notification code
\?SHORT_TEXT
The category within the notification code (null: none)
\?array
List of member IDs we are restricting to (null: no restriction). This effectively works as a intersection set operator against those who have enabled.
integer
Start position (for pagination)
integer
Maximum (for pagination)
boolean
Whether to find members who are subscribed regardless of notification code
array
A pair: Map of members to their notification setting, and whether there may be more_all_members_who_have_enabled_with_category_access(array $to_filter, \ID_TEXT $category, \ID_TEXT $only_if_enabled_on__notification_code, \?SHORT_TEXT $only_if_enabled_on__category, \?array $to_member_ids, integer $start, integer $max) : array
array
Members from main query (we'll filter them)
\ID_TEXT
The category permission type
\ID_TEXT
Notification code
\?SHORT_TEXT
The category within the notification code (null: none)
\?array
List of member IDs we are restricting to (null: no restriction). This effectively works as a intersection set operator against those who have enabled.
integer
Start position (for pagination)
integer
Maximum (for pagination)
array
A pair: Map of members to their notification setting, and whether there may be more_all_members_who_have_enabled_with_page_access(array $to_filter, \ID_TEXT $page, \ID_TEXT $only_if_enabled_on__notification_code, \?SHORT_TEXT $only_if_enabled_on__category, \?array $to_member_ids, integer $start, integer $max) : array
array
Members from main query (we'll filter them)
\ID_TEXT
The page
\ID_TEXT
Notification code
\?SHORT_TEXT
The category within the notification code (null: none)
\?array
List of member IDs we are restricting to (null: no restriction). This effectively works as a intersection set operator against those who have enabled.
integer
Start position (for pagination)
integer
Maximum (for pagination)
array
A pair: Map of members to their notification setting, and whether there may be more_all_members_who_have_enabled_with_privilege(array $to_filter, \ID_TEXT $privilege, \ID_TEXT $only_if_enabled_on__notification_code, \?SHORT_TEXT $only_if_enabled_on__category, \?array $to_member_ids, integer $start, integer $max) : array
array
Members from main query (we'll filter them)
\ID_TEXT
The privilege
\ID_TEXT
Notification code
\?SHORT_TEXT
The category within the notification code (null: none)
\?array
List of member IDs we are restricting to (null: no restriction). This effectively works as a intersection set operator against those who have enabled.
integer
Start position (for pagination)
integer
Maximum (for pagination)
array
A pair: Map of members to their notification setting, and whether there may be more_all_members_who_have_enabled_with_zone_access(array $to_filter, \ID_TEXT $zone, \ID_TEXT $only_if_enabled_on__notification_code, \?SHORT_TEXT $only_if_enabled_on__category, \?array $to_member_ids, integer $start, integer $max) : array
array
Members from main query (we'll filter them)
\ID_TEXT
The zone
\ID_TEXT
Notification code
\?SHORT_TEXT
The category within the notification code (null: none)
\?array
List of member IDs we are restricting to (null: no restriction). This effectively works as a intersection set operator against those who have enabled.
integer
Start position (for pagination)
integer
Maximum (for pagination)
array
A pair: Map of members to their notification setting, and whether there may be more_create_category_tree(\ID_TEXT $notification_code, \?ID_TEXT $id, boolean $for_any_member = false
) : array
\ID_TEXT
Notification code
\?ID_TEXT
The ID of where we're looking under (null: N/A)
boolean
Whether to list anything monitored by any member (useful if you are calling this because you can't naturally enumerate what can be monitored)
array
Tree structure_is_member(\?ID_TEXT $only_if_enabled_on__notification_code, \?SHORT_TEXT $only_if_enabled_on__category, \MEMBER $member_id) : boolean
\?ID_TEXT
Notification code (null: don't check if they are)
\?SHORT_TEXT
The category within the notification code (null: none)
\MEMBER
Member to check against
boolean
Whether they do