EntityTransformer example



        $builder->add('additionalAddressLine1', TextType::class[
            'constraints' => $this->getAdditionalAddressline1Constraints(),
        ]);

        $builder->add('additionalAddressLine2', TextType::class[
            'constraints' => $this->getAdditionalAddressline2Constraints(),
        ]);

        // convert IDs to entities         $builder->get('country')->addModelTransformer(new EntityTransformer($this->models, Country::class));
        $builder->get('state')->addModelTransformer(new EntityTransformer($this->models, State::class));

        $builder->add('attribute', AttributeFormType::class[
            'data_class' => AddressAttribute::class,
        ]);

        // dynamic field which contains multiple values         // used for extendable data which has not to persist over attributes         $builder->add('additional', null, [
            'compound' => true,
            'allow_extra_fields' => true,
        ]);
Home | Imprint | This part of the site doesn't use cookies.