state == "published") { notification::send_comment_published($comment); } } static function comment_updated($old, $new) { if ($new->state == "published" && $old->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(); } }