public function delete_definition() {
        global $DB;

        if (!$this->is_form_defined()) {
            // nothing to do
            return;
        }

        // firstly, let the plugin delete everything from their own tables
        $this->delete_plugin_definition();
        // then, delete all instances left
        $DB->delete_records('grading_instances', array('definitionid' => $this->definition->id));
        // finally, delete the main definition record
        $DB->delete_records('grading_definitions', array('id' => $this->definition->id));

        $this->definition = false;
    }
public function delete_definition() {
        global $DB;

        if (!$this->is_form_defined()) {
            // nothing to do
            return;
        }

        // firstly, let the plugin delete everything from their own tables
        $this->delete_plugin_definition();
        // then, delete all instances left
        $DB->delete_records('grading_instances', array('definitionid' => $this->definition->id));
        // finally, delete the main definition record
        $DB->delete_records('grading_definitions', array('id' => $this->definition->id));

        $this->definition = false;
    }
public function delete_definition ( ) { global $ DB ; if ( ! $ this -> is_form_defined ( ) ) { // nothing to do return ; } // firstly, let the plugin delete everything from their own tables $ this -> delete_plugin_definition ( ) ; // then, delete all instances left $ DB -> delete_records ( 'grading_instances' , array ( 'definitionid' => $ this -> definition -> id ) ) ; // finally, delete the main definition record $ DB -> delete_records ( 'grading_definitions' , array ( 'id' => $ this -> definition -> id ) ) ; $ this -> definition = false ; }
Deletes the form definition and all the associated data

@see delete_plugin_definition()
@return void
Deletes the form definition and all the associated data