diff options
author | Tim Almdal <tnalmdal@shaw.ca> | 2009-02-08 17:32:37 +0000 |
---|---|---|
committer | Tim Almdal <tnalmdal@shaw.ca> | 2009-02-08 17:32:37 +0000 |
commit | 0f9c5feb895f64575ab7334140846f9ab532d00e (patch) | |
tree | 2c844ed2449866ba7ebba5ba21212acd4ac1f191 | |
parent | 3a83c4e76fcfd3e9e62d95fe91222367527411e4 (diff) |
Use the ORM method delete_all to remove selected records from the
database instead of calling the Database::query with raw sql.
-rw-r--r-- | modules/notification/helpers/notification_event.php | 5 |
1 files changed, 3 insertions, 2 deletions
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(); } } |