Add option to limit the maximum thread depth of comments

This commit is contained in:
Kijin Sung 2024-10-09 16:45:36 +09:00
parent 81d9f46098
commit a4e9eb4a00
8 changed files with 60 additions and 0 deletions

View file

@ -246,6 +246,18 @@ class CommentModel extends Comment
return $result;
}
/**
* Get comment depth.
*
* @param int $comment_srl
* @return ?int
*/
public static function getCommentDepth(int $comment_srl): ?int
{
$output = executeQuery('comment.getCommentDepth', ['comment_srl' => $comment_srl]);
return isset($output->data->depth) ? (int)$output->data->depth : null;
}
/**
* Get the total number of comments in corresponding with document_srl.
* @param int $document_srl