Load Container and EntityManager within a fixture in Symfony2
问题 I have two fixtures, one LoadSport.php and one LoadCategory.php in my Symfony project. Every instance of sport has a private 'category' attribute which is an instance of Category. I am trying to retrieve the categories I already in my database and load them in the Sports fixture (I chose some sports). I followed the official using container within fixtures (http://symfony.com/doc/current/bundles/DoctrineFixturesBundle/index.html#using-the-container-in-the-fixtures) as suggested in another