Symfony error when inserting new game: Entities passed to the choice field must be managed. Maybe persist them in the entity manager?
问题 I'm trying to save a Game object with a Type object. When I try to save with the form I get the following error: Entities passed to the choice field must be managed. Maybe persist them in the entity manager? One Game can have 1 Type while Type can have many Games. I've managed to isolate the problem, it works fine when Game doesn't have a relation with Type so I think it has to do something with the Type object. GameController: <?php namespace AppBundle\Controller; use AppBundle\Entity\Game;