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); } } }