php - symfony 2 - object created twice -
in current symfony project work doctrine.
in 1 of controllers creating object , saving db:
$article = new article(); $article->setname('article'); $em = $this->getdoctrine()->getmanager(); $em->persist($article); $em->flush(); $data = $this->prepareindexaction(); $html = $this->container->get('templating')->render( 'index.html.twig', ['data' => $data] ); return new response($html);
this object saved 2 times database.
anybody knows how deal this?
greetings , thanks!
Comments
Post a Comment