I have a user document and an address document. They are linked using the @gedmo \ references doctrine extension. This ratio works great. I can get links to referenceMany and referenceOne.
Now I need to use it in the form of sonataUserBundle so that the user can add multiple addresses for the user. (user in mysql, address in mongodb).
I tried using this in the userAdmin class:
$formMapper->add('addresses', 'sonata_type_model', array(
'class' => 'Application\Sonata\UserBundle\Document\Address',
'required' => false,
'expanded' => true,
'multiple' => true
))
this gives me an error:
No entity manager defined for class Application\Sonata\UserBundle\Document\Address
Please tell me what to do!
source
share