src/Extensions/CommentsExtension.php
public function Comments()
    {
        $list = $this->AllVisibleComments();

        // If nesting comments, only show root level
        if ($this->owner->getCommentsOption('nested_comments')) {
            $list = $list->filter('ParentCommentID', 0);
        }

        $this->owner->extend('updateComments', $list);
        return $list;
    }
public function Comments()
    {
        $list = $this->AllVisibleComments();

        // If nesting comments, only show root level
        if ($this->owner->getCommentsOption('nested_comments')) {
            $list = $list->filter('ParentCommentID', 0);
        }

        $this->owner->extend('updateComments', $list);
        return $list;
    }
public function Comments ( ) { $ list = $ this -> AllVisibleComments ( ) ; // If nesting comments, only show root level if ( $ this -> owner -> getCommentsOption ( 'nested_comments' ) ) { $ list = $ list -> filter ( 'ParentCommentID' , 0 ) ; } $ this -> owner -> extend ( 'updateComments' , $ list ) ; return $ list ; }
Returns the root level comments, with spam and unmoderated items excluded, for use in the frontend

@return DataList
Returns the root level comments with spam and unmoderated items excluded for use in the frontend