我想做什麼:我試圖做一個文件上傳並將其數據保存到數據庫,在官方Symfony 2教程http://symfony.com/doc/current/cookbook/doctrine/file_uploads.html。學說不想堅持我的實體,雖然一切都好像
我得到什麼,而不是: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'author' cannot be null
我的實體 - >http://pastebin.com/av0XAASj
我的控制器 - >http://pastebin.com/bQ32UUsa
完整的錯誤的錯誤,我得到的,儘管 '作者' 調用之前設置正確'persist'方法 http://i.imgur.com/crOqDUe.jpg
*我有意將$作者的Entity屬性設置爲public能夠在堅持控制器之前var_dump。當它是私人的問題保持不變。*