/**
  * {@inheritdoc}
  *
  * @return array
  */
 public function reverseTransform($array)
 {
     if ($array === null || !isset($array['list'])) {
         return ['list' => []];
     }
     $array['list'] = AbstractFormFieldHelper::parseList($array['list'], $this->removeEmpty);
     return $array;
 }
示例#2
0
 /**
  * FormFieldHelper constructor.
  *
  * @param TranslatorInterface $translator
  * @param ValidatorInterface  $validator
  */
 public function __construct(TranslatorInterface $translator, ValidatorInterface $validator = null)
 {
     $this->translator = $translator;
     if (null === $validator) {
         $validator = $validator = Validation::createValidator();
     }
     $this->validator = $validator;
     parent::__construct();
 }