following error message:
The form's view data is expected to be of type scalar, array or an instance of \ArrayAccess, but is an instance of class Proxies__CG__\XXX\YYYBundle\Entity\XXXGeo. You can avoid this error by setting the "data_class" option to "Proxies__CG__\XXX\YYYBundle\Entity\XXXGeo" or by adding a view transformer that transforms an instance of class Proxies__CG__\XXX\YYYBundle\Entity\XXXGeo to scalar, array or an instance of \ArrayAccess.
the field XXXGeo is an embedded form:
->add('geo',
new XXXGeoType(),
array(
'required' => true
)
here the code of it:
class XXXGeoType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('address')
->add('city','text', array('data' => 'Somecity'))
->add('zip')
;
}
public function getDefaultOptions(array $options)
{
return array(
'data_class' => 'XXX\YYYBundle\Entity\XXXGeo',
);
}
public function getName()
{
return 'xxx_yyybundle_xxxgeotype';
}
}