public function get_instance_data(int $instanceid, bool $returnall = false) : array {
        $fields = $returnall ? $this->get_fields() : $this->get_visible_fields($instanceid);
        return api::get_instance_fields_data($fields, $instanceid);
    }