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) { $db = Database::instance(); $db->query("DELETE FROM subscriptions WHERE `user_id` = $user->id;"); } }