From 376eb5673fd9cbc06abf308a04f83231de1a1d11 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Sun, 1 Nov 2009 10:22:56 -0800 Subject: Convert the event handlers for the "identity provider changed" and "user_deleted" events to use ORM or the Kohana query builder to build the database update calls instead of coding the sql directly. --- modules/notification/helpers/notification_event.php | 7 +++++-- 1 file changed, 5 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 b82e4f0f..6b2df574 100644 --- a/modules/notification/helpers/notification_event.php +++ b/modules/notification/helpers/notification_event.php @@ -53,11 +53,14 @@ class notification_event_Core { } static function user_deleted($user) { - Database::instance()->query("DELETE FROM {subscriptions} where user_id = {$user->id}"); + ORM::factory("subscriptions") + ->where(array("user_id", $user->id)) + ->delete_all(); } static function identity_provider_changed($old_provider, $new_provider) { - Database::instance()->query("DELETE FROM {subscriptions}"); + ORM::factory("subscriptions") + ->delete_all(); } static function comment_created($comment) { -- cgit v1.2.3