Function Hook_notification_ecommerce->list_members_who_have_enabled
Definitions
sources/hooks/systems/notifications/ecommerce.php
- Get a list of members who have enabled this notification (i.e. have permission to AND have chosen to or are defaulted to).
- Visibility: public
- Is abstract?: No
- Is static?: No
- Is final?: No
- Returns: array
Parameters
| Name | Type | Passed by reference? | Variadic? | Default | Set | Range | Description |
|---|---|---|---|---|---|---|---|
| $notification_code | ID_TEXT | No | No | required parameter | N/A | N/A | Notification code |
| $category | ?SHORT_TEXT | No | No | Null | N/A | N/A | The category within the notification code (null: none) |
| $to_member_ids | ?array | No | No | Null | 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. |
| $from_member_id | ?integer | No | No | Null | N/A | N/A | The member ID doing the sending. Either a MEMBER or a negative number (e.g. A_FROM_SYSTEM_UNPRIVILEGED) (null: current member) |
| $start | integer | No | No | 0 | N/A | N/A | Start position (for pagination) |
| $max | integer | No | No | 300 | 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 members who have enabled this notification (i.e. have permission to AND have chosen to or are defaulted to).
*
* @param ID_TEXT $notification_code Notification code
* @param ?SHORT_TEXT $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 $from_member_id The member ID doing the sending. Either a MEMBER or a negative number (e.g. A_FROM_SYSTEM_UNPRIVILEGED) (null: current member)
* @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
*/
public function list_members_who_have_enabled(string $notification_code, ?string $category = null, ?array $to_member_ids = null, ?int $from_member_id = null, int $start = 0, int $max = 300) : array
* Get a list of members who have enabled this notification (i.e. have permission to AND have chosen to or are defaulted to).
*
* @param ID_TEXT $notification_code Notification code
* @param ?SHORT_TEXT $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 $from_member_id The member ID doing the sending. Either a MEMBER or a negative number (e.g. A_FROM_SYSTEM_UNPRIVILEGED) (null: current member)
* @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
*/
public function list_members_who_have_enabled(string $notification_code, ?string $category = null, ?array $to_member_ids = null, ?int $from_member_id = null, int $start = 0, int $max = 300) : array

