Function Hook_notification__Staff->_all_staff_who_have_enabled

Definitions

sources/notifications.php

  • Get a list of staff members who have enabled this notification (i.e. have permission to AND have chosen to or are defaulted to).
  • 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)

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 staff members who have enabled this notification (i.e. have permission to AND have chosen to or are defaulted to).
 *
 * @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)
 * @return array A pair: Map of members to their notification setting, and whether there may be more
 */

protected function _all_staff_who_have_enabled(string $only_if_enabled_on__notification_code, ?string $only_if_enabled_on__category, ?array $to_member_ids, int $start, int $max) : array