/** * {@inheritdoc} */ public function buildForm(FormBuilderInterface $builder, array $options) { $builder->addEventSubscriber(new CollectionUploadSubscriber($builder->getName(), $options, $this->storage)); if (!$builder->hasAttribute('prototype')) { $prototype = $builder->create($options['prototype_name'], $options['type'], array_replace(array('label' => $options['prototype_name'] . 'label__'), $options['options'])); $builder->setAttribute('prototype', $prototype->getForm()); } }