Function __global->set_notifications

Definitions

sources/notifications.php

  • Set a notification setting for a member on a notification code+category.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: bool

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$notification_code ID_TEXT No No required parameter N/A N/A The notification code to use
$notification_category ?SHORT_TEXT No No required parameter N/A N/A The category within the notification code (null: none)
$member_id ?MEMBER No No Null N/A N/A The member being signed up (null: current member)
$setting ?integer No No Null N/A N/A Setting to use (null: default)
$reset_for_all_types boolean No No True N/A N/A Reset all notification codes, not just set for $setting

Returns

  • Whether a change was actually made to the notification settings
  • Type: boolean
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Set a notification setting for a member on a notification code+category.
 *
 * @param  ID_TEXT $notification_code The notification code to use
 * @param  ?SHORT_TEXT $notification_category The category within the notification code (null: none)
 * @param  ?MEMBER $member_id The member being signed up (null: current member)
 * @param  ?integer $setting Setting to use (null: default)
 * @param  boolean $reset_for_all_types Reset all notification codes, not just set for $setting
 * @return boolean Whether a change was actually made to the notification settings
 */

function set_notifications(string $notification_code, ?string $notification_category, ?int $member_id = null, ?int $setting = null, bool $reset_for_all_types = true) : bool