What I want to do: I am trying to make a file upload and save it's data to database following the official Symfony 2 tutorial at http://symfony.com/doc/current/cookbook/doctrine/file_uploads.html .
What I get instead:
SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'author' cannot be null
My entity -> http://pastebin.com/av0XAASj
My controller -> http://pastebin.com/bQ32UUsa
The full error error I get, although 'author' is properly set before calling the 'persist' method http://i.imgur.com/crOqDUe.jpg
*I purposefully have set the $author Entity property to public to be able to var_dump it just before persist in controller. When it's private the problem stays the same.*