public function rename(string $name) {
        global $DB, $USER;

        $this->model->name = $name;
        $this->model->timemodified = time();
        $this->model->usermodified = $USER->id;

        $DB->update_record('analytics_models', $this->model);
    }