diff --git a/phpBB/includes/notification/manager.php b/phpBB/includes/notification/manager.php index 90916401c0..a5e1b09754 100644 --- a/phpBB/includes/notification/manager.php +++ b/phpBB/includes/notification/manager.php @@ -713,7 +713,7 @@ class phpbb_notification_manager * is disabled so that all those notifications are hidden and do not * cause errors * - * @param string $item_type + * @param string $item_type Type identifier of the subscription */ public function disable_notifications($item_type) { @@ -729,7 +729,7 @@ class phpbb_notification_manager * This should be called when an extension which has notification types * is purged so that all those notifications are removed * - * @param string $item_type + * @param string $item_type Type identifier of the subscription */ public function purge_notifications($item_type) { @@ -745,7 +745,7 @@ class phpbb_notification_manager * that was disabled is re-enabled so that all those notifications that * were hidden are shown again * - * @param string $item_type + * @param string $item_type Type identifier of the subscription */ public function enable_notifications($item_type) { @@ -755,6 +755,18 @@ class phpbb_notification_manager $this->db->sql_query($sql); } + /** + * Delete all notifications older than a certain time + * + * @param int $timestamp Unix timestamp to delete all notifications that were created before + */ + public function prune_notifications($timestamp) + { + $sql = 'DELETE FROM ' . $this->notifications_table . ' + WHERE time < ' . (int) $timestamp; + $this->db->sql_query($sql); + } + /** * Helper to get the notifications item type class and set it up */