diff options
| author | David King <imkingdavid@gmail.com> | 2013-09-12 21:24:11 -0700 |
|---|---|---|
| committer | David King <imkingdavid@gmail.com> | 2013-09-12 21:24:11 -0700 |
| commit | d62973867511d4f2b337a4c1cf3654ee20a2a107 (patch) | |
| tree | 6124d4dff71fea9d64ab4ed511c9bec8b624533b /phpBB/phpbb/notification/manager.php | |
| parent | f02a8cf0e63c4107550fc4d9d973c34ffbfe0e03 (diff) | |
| parent | 9bec7b21a2aae7328592732122faf4b9b1cfc4be (diff) | |
| download | forums-d62973867511d4f2b337a4c1cf3654ee20a2a107.tar forums-d62973867511d4f2b337a4c1cf3654ee20a2a107.tar.gz forums-d62973867511d4f2b337a4c1cf3654ee20a2a107.tar.bz2 forums-d62973867511d4f2b337a4c1cf3654ee20a2a107.tar.xz forums-d62973867511d4f2b337a4c1cf3654ee20a2a107.zip | |
Merge pull request #1617 from EXreaction/ticket/11744
[ticket/11744] Group join request notification
Diffstat (limited to 'phpBB/phpbb/notification/manager.php')
| -rw-r--r-- | phpBB/phpbb/notification/manager.php | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/phpBB/phpbb/notification/manager.php b/phpBB/phpbb/notification/manager.php index 97833710c0..acfc984ddc 100644 --- a/phpBB/phpbb/notification/manager.php +++ b/phpBB/phpbb/notification/manager.php @@ -59,7 +59,7 @@ class phpbb_notification_manager /** * Notification Constructor - * + * * @param array $notification_types * @param array $notification_methods * @param ContainerBuilder $phpbb_container @@ -490,15 +490,15 @@ class phpbb_notification_manager * * @param string|array $notification_type_name Type identifier or array of item types (only acceptable if the $item_id is identical for the specified types) * @param int|array $item_id Identifier within the type (or array of ids) - * @param array $data Data specific for this type that will be updated + * @param mixed $parent_id Parent identifier within the type (or array of ids), used in combination with item_id if specified (Default: false; not checked) */ - public function delete_notifications($notification_type_name, $item_id) + public function delete_notifications($notification_type_name, $item_id, $parent_id = false) { if (is_array($notification_type_name)) { foreach ($notification_type_name as $type) { - $this->delete_notifications($type, $item_id); + $this->delete_notifications($type, $item_id, $parent_id); } return; @@ -508,7 +508,8 @@ class phpbb_notification_manager $sql = 'DELETE FROM ' . $this->notifications_table . ' WHERE notification_type_id = ' . (int) $notification_type_id . ' - AND ' . (is_array($item_id) ? $this->db->sql_in_set('item_id', $item_id) : 'item_id = ' . (int) $item_id); + AND ' . (is_array($item_id) ? $this->db->sql_in_set('item_id', $item_id) : 'item_id = ' . (int) $item_id) . + (($parent_id !== false) ? ' AND ' . ((is_array($parent_id) ? $this->db->sql_in_set('item_parent_id', $parent_id) : 'item_parent_id = ' . (int) $parent_id)) : ''); $this->db->sql_query($sql); } @@ -834,12 +835,12 @@ class phpbb_notification_manager protected function load_object($object_name) { $object = $this->phpbb_container->get($object_name); - + if (method_exists($object, 'set_notification_manager')) { $object->set_notification_manager($this); } - + return $object; } |
