/**
  * Parse multiple field notation
  *
  * Multiple fields are either denoted as name:#:en
  * or contacts:0:contactType
  *
  * Since the supported values (0,1,3,... or nl,en,etc) are known only the first config will be parsed.
  *
  * @param $fieldName
  * @param $fieldInfo
  * @return array
  */
 private function addChildForFieldConfig($fieldName, $fieldInfo)
 {
     $fieldConfig = $this->findConfig($fieldInfo);
     if ($fieldConfig) {
         $this->children[$fieldName] = $this->metadataFieldConfigFactory->createFromSimpleSamlPhpConfig($fieldConfig);
         return;
     }
     if (!is_array($fieldInfo)) {
         return;
     }
     $keys = implode(':', array_keys($fieldInfo));
     $isCollection = !preg_match('/[^#\\d:]/', $keys);
     if (!$isCollection) {
         $group = new self('group', false);
         $group->addChildConfig($fieldInfo);
         $this->children[$fieldName] = $group;
         return;
     }
     $firstConfig = reset($fieldInfo);
     $fieldConfig = $this->findConfig($firstConfig);
     if ($fieldConfig) {
         $this->children[$fieldName] = new MetadataFieldConfigCollection($this->metadataFieldConfigFactory->createFromSimpleSamlPhpConfig($fieldConfig));
         return;
     }
     $supportedKeys = $this->findSupportedKeysForGroupCollection($firstConfig);
     // Some fields are defined with a hardcoded index
     if (empty($supportedKeys)) {
         if (!strstr($keys, '#')) {
             $supportedKeys = array(0);
         }
     }
     $group = new MetadataFieldConfig('group', false, $supportedKeys);
     $group->addChildConfig($firstConfig);
     $this->children[$fieldName] = new MetadataFieldConfigCollection($group);
 }
 /**
  * @return array
  */
 public function getChoices()
 {
     return $this->fieldConfig->getChoices();
 }