Suppose that we have a value object or, more in general, an object where its data has been set in the constructor
|
class Foo { protected $bar; protected $foobar; public function construct($bar, $foobar) { // .... } } |
and its FormType
|
class FooType extends AbstractType { public function buildForm(FormBuilderInterface $builder, array $options) { $builder ->add('bar') ->add('foobar'); } // ... } |
Let’s assume that bar and foobar are taken from HTTP POST values (so, basically, we need those values to be posted…