summaryrefslogtreecommitdiff
path: root/modules/notification/helpers/notification_event.php
diff options
context:
space:
mode:
Diffstat (limited to 'modules/notification/helpers/notification_event.php')
-rw-r--r--modules/notification/helpers/notification_event.php42
1 files changed, 22 insertions, 20 deletions
diff --git a/modules/notification/helpers/notification_event.php b/modules/notification/helpers/notification_event.php
index 6b2df574..2c7ede27 100644
--- a/modules/notification/helpers/notification_event.php
+++ b/modules/notification/helpers/notification_event.php
@@ -25,8 +25,8 @@ class notification_event_Core {
try {
notification::send_item_updated($new);
} catch (Exception $e) {
- Kohana::log("error", "@todo notification_event::item_updated() failed");
- Kohana::Log("error", $e->getMessage() . "\n" . $e->getTraceAsString());
+ Kohana_Log::add("error", "@todo notification_event::item_updated() failed");
+ Kohana_Log::add("error", $e->getMessage() . "\n" . $e->getTraceAsString());
}
}
@@ -34,8 +34,8 @@ class notification_event_Core {
try {
notification::send_item_add($item);
} catch (Exception $e) {
- Kohana::log("error", "@todo notification_event::item_created() failed");
- Kohana::Log("error", $e->getMessage() . "\n" . $e->getTraceAsString());
+ Kohana_Log::add("error", "@todo notification_event::item_created() failed");
+ Kohana_Log::add("error", $e->getMessage() . "\n" . $e->getTraceAsString());
}
}
@@ -47,20 +47,22 @@ class notification_event_Core {
notification::remove_watch($item);
}
} catch (Exception $e) {
- Kohana::log("error", "@todo notification_event::item_deleted() failed");
- Kohana::Log("error", $e->getMessage() . "\n" . $e->getTraceAsString());
+ Kohana_Log::add("error", "@todo notification_event::item_deleted() failed");
+ Kohana_Log::add("error", $e->getMessage() . "\n" . $e->getTraceAsString());
}
}
static function user_deleted($user) {
- ORM::factory("subscriptions")
- ->where(array("user_id", $user->id))
- ->delete_all();
+ db::build()
+ ->delete("subscriptions")
+ ->where("user_id", "=", $user->id)
+ ->execute();
}
static function identity_provider_changed($old_provider, $new_provider) {
- ORM::factory("subscriptions")
- ->delete_all();
+ db::build()
+ ->delete("subscriptions")
+ ->execute();
}
static function comment_created($comment) {
@@ -69,8 +71,8 @@ class notification_event_Core {
notification::send_comment_published($comment);
}
} catch (Exception $e) {
- Kohana::log("error", "@todo notification_event::comment_created() failed");
- Kohana::Log("error", $e->getMessage() . "\n" . $e->getTraceAsString());
+ Kohana_Log::add("error", "@todo notification_event::comment_created() failed");
+ Kohana_Log::add("error", $e->getMessage() . "\n" . $e->getTraceAsString());
}
}
@@ -80,19 +82,19 @@ class notification_event_Core {
notification::send_comment_published($new);
}
} catch (Exception $e) {
- Kohana::log("error", "@todo notification_event::comment_updated() failed");
- Kohana::Log("error", $e->getMessage() . "\n" . $e->getTraceAsString());
+ Kohana_Log::add("error", "@todo notification_event::comment_updated() failed");
+ Kohana_Log::add("error", $e->getMessage() . "\n" . $e->getTraceAsString());
}
}
static function user_before_delete($user) {
try {
ORM::factory("subscription")
- ->where("user_id", $user->id)
+ ->where("user_id", "=", $user->id)
->delete_all();
} catch (Exception $e) {
- Kohana::log("error", "@todo notification_event::user_before_delete() failed");
- Kohana::Log("error", $e->getMessage() . "\n" . $e->getTraceAsString());
+ Kohana_Log::add("error", "@todo notification_event::user_before_delete() failed");
+ Kohana_Log::add("error", $e->getMessage() . "\n" . $e->getTraceAsString());
}
}
@@ -100,8 +102,8 @@ class notification_event_Core {
try {
notification::send_pending_notifications();
} catch (Exception $e) {
- Kohana::log("error", "@todo notification_event::batch_complete() failed");
- Kohana::Log("error", $e->getMessage() . "\n" . $e->getTraceAsString());
+ Kohana_Log::add("error", "@todo notification_event::batch_complete() failed");
+ Kohana_Log::add("error", $e->getMessage() . "\n" . $e->getTraceAsString());
}
}