public function createAction(Request $request)
{
$individualUser = new IndividualUser();
$iform = $this->createForm('BackendBundle\Form\IndividualUserType', $individualUser);
$iform->handleRequest($request);
$user = new User();
$form = $this->createForm('BackendBundle\Form\UserType', $user);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
$em = $this->getDoctrine()->getManager();
$individualUser->setUser($user->getId());
$em->persist($individualUser);
$em->persist($user);
$em->flush();
return $this->redirectToRoute('_user_index');
}
return $this->render('BackendBundle:User:create.html.twig',array(
'form' => $form->createView(),
'iform' => $oform->createView()
));
}
Ошибка
An exception occurred while executing 'INSERT INTO individualuser (firstname, lastname, phone, user_id) VALUES (?, ?, ?, ?)' with params [null, null, null, null]:
Поправьте, пожалуйста, где я ошибся.