protected function is_temporary_course_created($courseid) {
        global $DB;
        // Check if current controller instance has created new course.
        if ($this->controller->get_target() == backup::TARGET_NEW_COURSE) {
            $results = $DB->record_exists_sql("SELECT bc.itemid
                                               FROM {backup_controllers} bc, {course} c
                                               WHERE bc.operation = 'restore'
                                                 AND bc.type = 'course'
                                                 AND bc.itemid = c.id
                                                 AND bc.itemid = ?",
                                               array($courseid)
                                             );
            return $results;
        }
        return false;
    }
protected function is_temporary_course_created($courseid) {
        global $DB;
        // Check if current controller instance has created new course.
        if ($this->controller->get_target() == backup::TARGET_NEW_COURSE) {
            $results = $DB->record_exists_sql("SELECT bc.itemid
                                               FROM {backup_controllers} bc, {course} c
                                               WHERE bc.operation = 'restore'
                                                 AND bc.type = 'course'
                                                 AND bc.itemid = c.id
                                                 AND bc.itemid = ?",
                                               array($courseid)
                                             );
            return $results;
        }
        return false;
    }
protected function is_temporary_course_created ( $ courseid ) { global $ DB ; // Check if current controller instance has created new course. if ( $ this -> controller -> get_target ( ) == backup :: TARGET_NEW_COURSE ) { $ results = $ DB -> record_exists_sql ( "SELECT bc.itemid
                                               FROM {backup_controllers} bc, {course} c
                                               WHERE bc.operation = 'restore'
                                                 AND bc.type = 'course'
                                                 AND bc.itemid = c.id
                                                 AND bc.itemid = ?" , array ( $ courseid ) ) ; return $ results ; } return false ; }
Checks if the course is not restored fully and current controller has created it.
@param int $courseid id of the course which needs to be checked
@return bool
Checks if the course is not restored fully and current controller has created it .