public function delete_all_overrides() {
        global $DB;

        $overrides = $DB->get_records('lesson_overrides', array('lessonid' => $this->properties->id), 'id');
        foreach ($overrides as $override) {
            $this->delete_override($override->id);
        }
    }