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

        // Filter spam comments for non-administrators if configured
        $showSpam = $this->owner->getCommentsOption('frontend_spam') && $this->owner->canModerateComments();

        if (!$showSpam) {
            $list = $list->filter('IsSpam', 0);
        }

        // Filter un-moderated comments for non-administrators if moderation is enabled
        $showUnmoderated = ($this->owner->ModerationRequired === 'None')
            || ($this->owner->getCommentsOption('frontend_moderation') && $this->owner->canModerateComments());
        if (!$showUnmoderated) {
            $list = $list->filter('Moderated', 1);
        }

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

        // Filter spam comments for non-administrators if configured
        $showSpam = $this->owner->getCommentsOption('frontend_spam') && $this->owner->canModerateComments();

        if (!$showSpam) {
            $list = $list->filter('IsSpam', 0);
        }

        // Filter un-moderated comments for non-administrators if moderation is enabled
        $showUnmoderated = ($this->owner->ModerationRequired === 'None')
            || ($this->owner->getCommentsOption('frontend_moderation') && $this->owner->canModerateComments());
        if (!$showUnmoderated) {
            $list = $list->filter('Moderated', 1);
        }

        $this->owner->extend('updateAllVisibleComments', $list);
        return $list;
    }
public function AllVisibleComments ( ) { $ list = $ this -> AllComments ( ) ; // Filter spam comments for non-administrators if configured $ showSpam = $ this -> owner -> getCommentsOption ( 'frontend_spam' ) && $ this -> owner -> canModerateComments ( ) ; if ( ! $ showSpam ) { $ list = $ list -> filter ( 'IsSpam' , 0 ) ; } // Filter un-moderated comments for non-administrators if moderation is enabled $ showUnmoderated = ( $ this -> owner -> ModerationRequired === 'None' ) || ( $ this -> owner -> getCommentsOption ( 'frontend_moderation' ) && $ this -> owner -> canModerateComments ( ) ) ; if ( ! $ showUnmoderated ) { $ list = $ list -> filter ( 'Moderated' , 1 ) ; } $ this -> owner -> extend ( 'updateAllVisibleComments' , $ list ) ; return $ list ; }
Returns all comments against this object, with with spam and unmoderated items excluded, for use in the frontend

@return DataList
Returns all comments against this object with with spam and unmoderated items excluded for use in the frontend