CommentList::getReplies PHP Method

getReplies() public method

Get replies to the given comment ID, or 0 for root level comments
public getReplies ( integer | Comment $commentID ) : array
$commentID integer | Comment
return array
    public function getReplies($commentID)
    {
        if (is_object($commentID)) {
            $commentID = $commentID->id;
        }
        $commentID = (int) $commentID;
        $admin = $this->options['admin'];
        $replies = array();
        foreach ($this->comments as $c) {
            if ($c->parent_id != $commentID) {
                continue;
            }
            if (!$admin && $c->status != Comment::statusApproved) {
                continue;
            }
            $replies[] = $c;
        }
        return $replies;
    }