Function Hook_Notification->_all_members_who_have_enabled

Definitions

sources/notifications.php

  • Get a list of members who have enabled this notification (i.e. have chosen to or are defaulted to).(No pagination supported, as assumed there are only a small set of members here).
  • Visibility: protected
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: array

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$only_if_enabled_on__notification_code ID_TEXT No No required parameter N/A N/A Notification code
$only_if_enabled_on__category ?SHORT_TEXT No No required parameter N/A N/A The category within the notification code (null: none)
$to_member_ids ?array No No required parameter N/A N/A List of member IDs we are restricting to (null: no restriction). This effectively works as a intersection set operator against those who have enabled.
$start integer No No required parameter N/A N/A Start position (for pagination)
$max integer No No required parameter N/A N/A Maximum (for pagination)
$catch_all_too boolean No No True N/A N/A Whether to find members who are subscribed to the notification code for any category

Returns

  • A pair: Map of members to their notification setting, and whether there may be more
  • Type: array
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Get a list of members who have enabled this notification (i.e. have chosen to or are defaulted to).(No pagination supported, as assumed there are only a small set of members here).
 *
 * @param  ID_TEXT $only_if_enabled_on__notification_code Notification code
 * @param  ?SHORT_TEXT $only_if_enabled_on__category The category within the notification code (null: none)
 * @param  ?array $to_member_ids List of member IDs we are restricting to (null: no restriction). This effectively works as a intersection set operator against those who have enabled.
 * @param  integer $start Start position (for pagination)
 * @param  integer $max Maximum (for pagination)
 * @param  boolean $catch_all_too Whether to find members who are subscribed to the notification code for any category
 * @return array A pair: Map of members to their notification setting, and whether there may be more
 */

protected function _all_members_who_have_enabled(string $only_if_enabled_on__notification_code, ?string $only_if_enabled_on__category, ?array $to_member_ids, int $start, int $max, bool $catch_all_too = true) : array