/**
  * @param FieldTypeInterface $fieldType
  *
  * @return FacadeInterface
  *
  * @throws TransformerParameterTypeException
  */
 public function transform($fieldType)
 {
     if (!$fieldType instanceof FieldTypeInterface) {
         throw new TransformerParameterTypeException();
     }
     $facade = $this->newFacade();
     $facade->fieldId = $fieldType->getFieldId();
     $facade->label = $this->multiLanguagesChoiceManagerInterface->choose($fieldType->getLabels());
     $facade->defaultValue = $fieldType->getDefaultValue();
     $facade->searchable = $fieldType->isSearchable();
     $facade->listable = $fieldType->getListable();
     $facade->type = $fieldType->getType();
     foreach ($fieldType->getOptions() as $option) {
         $value = $option->getValue();
         if (!is_string($value)) {
             $value = \serialize($value);
         }
         $facade->addOption($option->getKey(), $value);
     }
     return $facade;
 }
 /**
  * Add $contentTypeField to $form with value $fieldValue
  *
  * @param FieldTypeInterface $contentTypeField
  * @param FormInterface      $form
  */
 protected function addFieldToForm(FieldTypeInterface $contentTypeField, FormInterface $form)
 {
     $fieldTypeConfiguration = $this->fieldTypesConfiguration[$contentTypeField->getType()];
     $fieldParameters = array_merge(array('label' => $this->multiLanguagesChoiceManager->choose($contentTypeField->getLabels()), 'mapped' => false), $this->getFieldOptions($contentTypeField));
     if (isset($fieldParameters['required']) && $fieldParameters['required'] === true) {
         $fieldParameters['constraints'] = new NotBlank();
     }
     $form->add($contentTypeField->getFieldId(), $fieldTypeConfiguration['type'], $fieldParameters);
 }