public function delete($source=null) {
        global $DB;
        if (!empty($this->courseid)) {
            $DB->delete_records('grade_outcomes_courses', array('outcomeid' => $this->id, 'courseid' => $this->courseid));
        }
        if (parent::delete($source)) {
            $context = context_system::instance();
            $fs = get_file_storage();
            $files = $fs->get_area_files($context->id, 'grade', 'outcome', $this->id);
            foreach ($files as $file) {
                $file->delete();
            }
            return true;
        }
        return false;
    }
public function delete($source=null) {
        global $DB;
        if (!empty($this->courseid)) {
            $DB->delete_records('grade_outcomes_courses', array('outcomeid' => $this->id, 'courseid' => $this->courseid));
        }
        if (parent::delete($source)) {
            $context = context_system::instance();
            $fs = get_file_storage();
            $files = $fs->get_area_files($context->id, 'grade', 'outcome', $this->id);
            foreach ($files as $file) {
                $file->delete();
            }
            return true;
        }
        return false;
    }
public function delete ( $ source = null ) { global $ DB ; if ( ! empty ( $ this -> courseid ) ) { $ DB -> delete_records ( 'grade_outcomes_courses' , array ( 'outcomeid' => $ this -> id , 'courseid' => $ this -> courseid ) ) ; } if ( parent :: delete ( $ source ) ) { $ context = context_system :: instance ( ) ; $ fs = get_file_storage ( ) ; $ files = $ fs -> get_area_files ( $ context -> id , 'grade' , 'outcome' , $ this -> id ) ; foreach ( $ files as $ file ) { $ file -> delete ( ) ; } return true ; } return false ; }
Deletes this outcome from the database.

@param string $source from where was the object deleted (mod/forum, manual, etc.)
@return bool success
Deletes this outcome from the database .