state == "published") { notification::send_comment_published($comment); } } static function comment_updated($item) { if ($item->state == "published" && $item->original("state") != "published") { notification::send_comment_published($new); } } static function user_before_delete($user) { ORM::factory("subscription") ->where("user_id", $user->id) ->delete_all(); } static function batch_complete() { notification::send_pending_notifications(); } }