original_string: public static function delete_field($id) {
          $params = self::validate_parameters(self::delete_field_parameters(), ['id' => $id]);
  
          $record = \core_customfield\field_controller::create($params['id']);
          $handler = $record->get_handler();
          if (!$handler->can_configure()) {
              throw new moodle_exception('nopermissionconfigure', 'core_customfield');
          }
          $handler->delete_field_configuration($record);
      }
code: public static function delete_field($id) {
          $params = self::validate_parameters(self::delete_field_parameters(), ['id' => $id]);
  
          $record = \core_customfield\field_controller::create($params['id']);
          $handler = $record->get_handler();
          if (!$handler->can_configure()) {
              throw new moodle_exception('nopermissionconfigure', 'core_customfield');
          }
          $handler->delete_field_configuration($record);
      }
code_tokens: public static function delete_field ( $ id ) { $ params = self :: validate_parameters ( self :: delete_field_parameters ( ) , [ 'id' => $ id ] ) ; $ record = \ core_customfield \ field_controller :: create ( $ params [ 'id' ] ) ; $ handler = $ record -> get_handler ( ) ; if ( ! $ handler -> can_configure ( ) ) { throw new moodle_exception ( 'nopermissionconfigure' , 'core_customfield' ) ; } $ handler -> delete_field_configuration ( $ record ) ; }
docstring: Delete custom field function
  
  @param int $id
docstring_tokens: Delete custom field function