diff options
author | Tim Almdal <tnalmdal@shaw.ca> | 2009-11-01 10:22:56 -0800 |
---|---|---|
committer | Tim Almdal <tnalmdal@shaw.ca> | 2009-11-01 10:22:56 -0800 |
commit | 376eb5673fd9cbc06abf308a04f83231de1a1d11 (patch) | |
tree | f240f33cc832a5bea3836a39334b7d56b06784d2 /modules/notification/helpers/notification_event.php | |
parent | 808fd4d3a0f38a2ea80bb8d56e1f8c6ce499e42d (diff) |
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.
Diffstat (limited to 'modules/notification/helpers/notification_event.php')
-rw-r--r-- | modules/notification/helpers/notification_event.php | 7 |
1 files changed, 5 insertions, 2 deletions
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) { |