I had a problem while saving data of conflict entity and it failed every time the methods is called.
$em->persist($conflict);
return back a blank screen and show a string 'persist'. I don't know how to solve it as I am new to symfony2.
Here is my sample code on create conflict controller.
public function createAction() {
$conflict = new Conflict();
$form = $this->createForm(new ConflictType(), $conflict, array(
"container" => $this->container,
"em" => $this->getDoctrine()->getEntityManager()
));
$request = $this->getRequest();
$form->bindRequest($request);
if ($form->isValid()) {
$conflict->setAwardDeadlineCurrent($conflict->getAwardDeadlineInit());
$em = $this->getDoctrine()->getEntityManager();
$em->persist($conflict);
$em->flush();
$request->getSession()->setFlash("notice", "Case has been created");
return $this->redirect($this->generateUrl("acf_case_conflict_edit", array("id" => $conflict->getId())));
}
return $this->render("ACFCaseBundle:Conflict:new.html.twig", array("form" => $form->createView()));
}