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

Popular posts from this blog

yii2 - Yii 2 Running a Cron in the basic template -

asp.net - 'System.Web.HttpContext' does not contain a definition for 'GetOwinContext' Mystery -

mercurial graft feature, can it copy? -