* 'notifications' array of notification type objects * 'unread_count' number of unread notifications the user has if count_unread is true in the options * 'total_count' number of notifications the user has if count_total is true in the options

* 'notifications' array of notification type objects * 'unread_count' number of unread notifications the user has if count_unread is true in the options * 'total_count' number of notifications the user has if count_total is true in the options

* @throws \phpbb\notification\exception when the method doesn't refer to a class extending \phpbb\notification\method\method_interface

/** * Mark notifications read or unread for all available methods * * @param bool|string|array $notification_type_name Type identifier or array of item types (only acceptable if the $data is identical for the specified types). False to mark read for all item types * @param bool|int|array $item_id Item id or array of item ids. False to mark read for all item ids * @param bool|int|array $user_id User id or array of user ids. False to mark read for all user ids * @param bool|int $time Time at which to mark all notifications prior to as read. False to mark all as read. (Default: False) * @param bool $mark_read Define if the notification as to be set to True or False. (Default: True) */ public function mark_notifications($notification_type_name, $item_id, $user_id, $time = false, $mark_read = true)

* @param bool|int|array $user_id User id or array of user ids. False to mark read for all user ids * @param bool|int $time Time at which to mark all notifications prior to as read. False to mark all as read. (Default: False)

* @param bool|int|array $user_id User id or array of user ids. False to mark read for all user ids * @param bool|int $time Time at which to mark all notifications prior to as read. False to mark all as read. (Default: False)

* @param int|array $notification_id Notification id or array of notification ids. * @param bool|int $time Time at which to mark all notifications prior to as read. False to mark all as read. (Default: False)

* @param int|array $notification_id Notification id or array of notification ids. * @param bool|int $time Time at which to mark all notifications prior to as read. False to mark all as read. (Default: False)

* @param bool $mark_read Define if the notification as to be set to True or False. (Default: True)

// find out which users want to receive this type of notification $notify_users = $this->get_item_type_class($notification_type_name)->find_users_for_notification($data, $options);

// find out which users want to receive this type of notification $notify_users = $this->get_item_type_class($notification_type_name)->find_users_for_notification($data, $options);

/** * Allow filtering the notify_users array for a notification that is about to be sent. * Here, $notify_users is already filtered by f_read and the ignored list included in the options variable * * @event core.notification_manager_add_notifications * @var string notification_type_name The forum id from where the topic belongs * @var array data Data specific for the notification_type_name used will be inserted * @var array notify_users The array of userid that are going to be notified for this notification. Set to array() to cancel. * @var array options The options that were used when this method was called (read only) * * @since 3.1.3-RC1 */ $vars = array( 'notification_type_name', 'data', 'notify_users', 'options', ); extract($this->phpbb_dispatcher->trigger_event('core.notification_manager_add_notifications', compact($vars)));

// We need to load all of the users to send notifications $this->user_loader->load_users($user_ids);

// We need to load all of the users to send notifications $this->user_loader->load_users($user_ids);

Line 449

Line 385

}

/**

}

/**

* Update a notification

* Update notification

* * @param string|array $notification_type_name Type identifier or array of item types (only acceptable if the $data is identical for the specified types) * @param array $data Data specific for this type that will be updated

* * @param string|array $notification_type_name Type identifier or array of item types (only acceptable if the $data is identical for the specified types) * @param array $data Data specific for this type that will be updated