public function getCommentDepth(int $commentId) : int { $parent = $this->db->cell('SELECT replyto FROM hull_blog_comments WHERE commentid = ?', $commentId); if (!$parent) { return 0; } return 1 + $this->getCommentDepth($parent); }