如何隔离我的数据

I have created a course list view where there are courses and preview courses in Moodle, where users can view all courses available within a block. In the following PHP, it is created to include list of newly published courses, however, I am not sure how to seperate such that the following published courses will only display the courses and not the preview course.

I have attached the following php code. please do help:

$courserenderer = $PAGE->get_renderer('core', 'course');
            $availablecourseshtml = $courserenderer->frontpage_available_courses();
            if (!empty($availablecourseshtml)) {
                echo html_writer::tag('a', get_string('skipa', 'access', core_text::strtolower(get_string('availablecourses'))), array('href'=>'#skipavailablecourses', 'class'=>'skip-block'));

                //wrap frontpage course list in div container
                echo html_writer::start_tag('div', array('id'=>'frontpage-course-list'));

                echo $OUTPUT->heading(get_string('availablecourses'));
                echo $availablecourseshtml;

                //end frontpage course list div container
                echo html_writer::end_tag('div');

                echo html_writer::tag('span', '', array('class'=>'skip-block-to', 'id'=>'skipavailablecourses'));
            }