public function delete() : bool {
        global $DB;
        $DB->delete_records('customfield_data', ['fieldid' => $this->get('id')]);
        return $this->field->delete();
    }
public function delete() : bool {
        global $DB;
        $DB->delete_records('customfield_data', ['fieldid' => $this->get('id')]);
        return $this->field->delete();
    }
public function delete ( ) : bool { global $ DB ; $ DB -> delete_records ( 'customfield_data' , [ 'fieldid' => $ this -> get ( 'id' ) ] ) ; return $ this -> field -> delete ( ) ; }
Delete a field and all associated data

Plugins may override it if it is necessary to delete related data (such as files)

Not that the delete() method from data_controller is not called here.

@return bool
Delete a field and all associated data