I have a User entity and Address document. They are linked between each other with @gedmo\references doctrine extension. This relation works just fine. I can get both referenceMany and referenceOne linked objects.
Now i need to use it at the sonataUserBundle form to let user to add multiple addresses for the user. (user - in mysql, address - in mongodb).
I tried to use this in the userAdmin class:
$formMapper->add('addresses', 'sonata_type_model', array(
'class' => 'Application\Sonata\UserBundle\Document\Address',
'required' => false,
'expanded' => true,
'multiple' => true
))
it gives me an error:
No entity manager defined for class Application\Sonata\UserBundle\Document\Address
Please, answer what should I do!