In a controller I have this after a form is submitted and isValid()
// ...
$em = $this->getDoctrine()->getEntityManager();
$em->persist($form->getData());
$em->flush();
// ...
I have checked the contents of $form->getData() and it looks fine but it’s not writing it to the table. I’m not getting any errors in the logs. How can I start debugging this?
in my Entity class, which was for user registration I had a date created field. In order to populate this field I had
However what I should have had is:
The reason I didn’t spot this is that no error was logged to the log files. I was submitting this form as an ajax call and didn’t think to look in the response for that ajax call for the error until I turned on firebug (was relying on the default chrome console)
I don’t remember the exact error that can back but it was around the DateTimeType.