简体   繁体   中英

persist many to many relation in database symfony2

When persisting my entity from a form, I get the following error when flushing in database :

Catchable Fatal Error: Argument 1 passed to Doctrine\Common\Collections\ArrayCollection::__construct() must be an array, object given, called in C:\wamp\www\Symfony\vendor\doctrine\orm\lib\Doctrine\ORM\UnitOfWork.php on line 519 and defined in C:\wamp\www\Symfony\vendor\doctrine\common\lib\Doctrine\Common\Collections\ArrayCollection.php line 48 

I think I am getting it in the object form but it must be in the array collection form which I can not understand

any ideas????

It may be both a wrong binding or an entity class misconfiguration. But without more code from you, we can't really guess what's going wrong :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM