public function getSectionFields($section, $flatten = true)
    {
        if ($flatten === false) {
            $fields = $this->fields;
        } else {
            $fields = $this->getFlattenedFields();
        }

        $matchedFields = array();
        foreach ($fields as $fieldName => $field) {
            if (isset($field['options']['section']) && $field['options']['section'] == $section) {
                $matchedFields[$fieldName] = $field;
            }
        }

        return $matchedFields;
    }