public function getFlattenedFields()
    {
        if (!isset($this->flatFields)) {
            $this->flatFields = [];

            foreach ($this->fields as $field) {
                if (isset($field['fields']) && is_array($field['fields'])) {
                    $this->flatFields += $this->flattenCollection($field);
                } else {
                    $this->flatFields[$field['name']] = $field;
                }
            }
        }

        return $this->flatFields;
    }