public function get_custom_fields() : array {
        if (!isset($this->record->customfields)) {
            $this->record->customfields = \core_course\customfield\course_handler::create()->get_instance_data($this->id);
        }
        return $this->record->customfields;
    }