original_string: 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;
      }
code: 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;
      }
code_tokens: 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 ; }
docstring: Deletes the form definition and all the associated data
  
  @see delete_plugin_definition()
  @return void
docstring_tokens: Deletes the form definition and all the associated data