我在表單中創建了另一個實體的嵌入式集合,這個想法是,當您編輯或刪除「需求」時也會編輯屬於它的「產品」,我的創建表單是好的,但編輯它給人的錯誤:symfony2嵌入式集合編輯表單
Catchable Fatal Error: Argument 1 passed to MaisAlimentos\DemandaBundle\Entity\Demanda::setProdutosDemanda() must be an instance of Doctrine\Common\Collections\ArrayCollection, instance of Doctrine\ORM\PersistentCollection given, called in /var/www/maa/vendor/symfony/src/Symfony/Component/Form/Util/PropertyPath.php on line 347 and defined in /var/www/maa/src/MaisAlimentos/DemandaBundle/Entity/Demanda.php line 130
我在一些論壇上閱讀,解決方法是刪除二傳手的類型,我還有其他的錯誤:
Catchable Fatal Error: Object of class Doctrine\ORM\PersistentCollection could not be converted to string in /var/www/maa/src/MaisAlimentos/DemandaBundle/Entity/Demanda.php line 136
我的代碼
對不起noob問題,錯誤是這樣的$ $ $ this-> –