From 0f9c5feb895f64575ab7334140846f9ab532d00e Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Sun, 8 Feb 2009 17:32:37 +0000 Subject: Use the ORM method delete_all to remove selected records from the database instead of calling the Database::query with raw sql. --- modules/notification/helpers/notification_event.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'modules/notification/helpers') diff --git a/modules/notification/helpers/notification_event.php b/modules/notification/helpers/notification_event.php index 22a810bf..66aa52c8 100644 --- a/modules/notification/helpers/notification_event.php +++ b/modules/notification/helpers/notification_event.php @@ -47,7 +47,8 @@ class notification_event_Core { } static function user_before_delete($user) { - $db = Database::instance(); - $db->query("DELETE FROM subscriptions WHERE `user_id` = $user->id;"); + ORM::factory("subscription") + ->where("user_id", $user->id) + ->delete_all(); } } -- cgit v1.2.3