Example #1
0
 /**
  * @inheritDoc
  *
  * @param FormBuilderInterface $builder The form builder
  * @param array                $options The options
  * @return void
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $dataTransformer = clone $this->transformer;
     $propertyPath = $builder->getPropertyPath();
     if ($propertyPath !== null) {
         $dataTransformer->setPropertyPath($propertyPath);
     }
     $dataTransformer->setSubmittedData($options['submitted_data']);
     // we won't use the standard view transformer, which is defined by the checkbox type
     $builder->resetViewTransformers();
     $builder->addViewTransformer($dataTransformer);
 }