changed ['staticValues'][$fieldName] to [$fieldName]['staticValues']
changed ['optionRefs'][$fieldName] to [$fieldName]['optionRefs']