Symfony3 - How to persist an object with its collections?
I have an object "person" with several collections ("documents", "contacts", "etc"). I would like to save "person" and automatically the collection too. This is my controller: $em = $this->getDoctrine()->getManager(); $persona = new Persona(); $formulario = $this->createForm( PersonaType::class, $persona, array('action' => $this->generateUrl('persona_create'), 'method' => 'POST') ); $formulario->handleRequest($request); $em->persist($persona); $em->flush(); When I dump "$persona", I have the collection and all the information that I need to save, but when I persist it, I lose all the