{"action":"created","issue":{"url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/issues/3508","labels_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/issues/3508/labels{/name}","comments_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/issues/3508/comments","events_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/issues/3508/events","html_url":"https://github.com/sonata-project/SonataAdminBundle/issues/3508","id":123991909,"number":3508,"title":"No entity manager defined for class Doctrine\\Common\\Collections\\ArrayCollection","user":{"login":"reypm","id":627886,"avatar_url":"https://avatars.githubusercontent.com/u/627886?v=3","gravatar_id":"","url":"https://api.github.com/users/reypm","html_url":"https://github.com/reypm","followers_url":"https://api.github.com/users/reypm/followers","following_url":"https://api.github.com/users/reypm/following{/other_user}","gists_url":"https://api.github.com/users/reypm/gists{/gist_id}","starred_url":"https://api.github.com/users/reypm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reypm/subscriptions","organizations_url":"https://api.github.com/users/reypm/orgs","repos_url":"https://api.github.com/users/reypm/repos","events_url":"https://api.github.com/users/reypm/events{/privacy}","received_events_url":"https://api.github.com/users/reypm/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-12-27T18:44:41Z","updated_at":"2015-12-28T16:27:56Z","closed_at":null,"body":"I am trying to setup a `ManyToMany` field using `sonata_type_model_list` but I can't get it to work perhaps is part of a **todo** since I am using Symfony 2.8 and this is not complete ready/migrated. Here is my code:\r\n\r\n```php\r\n        // PlatformBundle/Entity/Command.php\r\n\t...\r\n\tuse Doctrine\\Common\\Collections\\ArrayCollection;\r\n\r\n\tclass Command\r\n\t{\r\n\t\t...\r\n\r\n\t    /**\r\n\t     * @ORM\\ManyToMany(targetEntity=\"Alias\", inversedBy=\"alias_command\", cascade={\"persist\", \"remove\"})\r\n\t     * @ORM\\JoinTable(name=\"command_has_alias\",\r\n\t     *      joinColumns={@ORM\\JoinColumn(name=\"command_id\", referencedColumnName=\"id\")},\r\n\t     *      inverseJoinColumns={@ORM\\JoinColumn(name=\"alias_id\", referencedColumnName=\"id\")}\r\n\t     * )\r\n\t     */\r\n\t    protected $command_alias;\r\n\r\n\t    public function __construct()\r\n\t    {\r\n\t        $this->command_alias = new ArrayCollection();\r\n\t    }\r\n\r\n\t    ...\r\n\r\n\t    /**\r\n\t     * Add alias to command.\r\n\t     *\r\n\t     * @param Alias $alias\r\n\t     */\r\n\t    public function addCommandAlias(Alias $alias)\r\n\t    {\r\n\t        $this->command_alias[] = $alias;\r\n\t    }\r\n\r\n\t    /**\r\n\t     * Get alias from command.\r\n\t     *\r\n\t     * @return Doctrine\\Common\\Collections\\Collection\r\n\t     */\r\n\t    public function getCommandAlias()\r\n\t    {\r\n\t        return $this->command_alias;\r\n\t    }\r\n\r\n\t    /**\r\n\t     * Remove alias from command.\r\n\t     *\r\n\t     * @param Alias $alias\r\n\t     */\r\n\t    public function removeCommandAlias(Alias $alias)\r\n\t    {\r\n\t        $this->command_alias->removeElement($alias);\r\n\r\n\t        return $this;\r\n\t    }\r\n\t}\r\n\r\nAnd this is the Admin class:\r\n\r\n    // PlatformBundle/Controller/Admin/CommandAdmin.php\r\n    use Sonata\\AdminBundle\\Admin\\Admin;\r\n\tuse Sonata\\AdminBundle\\Datagrid\\ListMapper;\r\n\tuse Sonata\\AdminBundle\\Datagrid\\DatagridMapper;\r\n\tuse Sonata\\AdminBundle\\Form\\FormMapper;\r\n\tuse Sonata\\AdminBundle\\Show\\ShowMapper;\r\n\tuse Symfony\\Bridge\\PhpUnit\\TextUI\\Command;\r\n\r\n\tclass CommandAdmin extends Admin\r\n\t{\r\n\t    // Fields to be shown on create/edit forms\r\n\t    protected function configureFormFields(FormMapper $formMapper)\r\n\t    {\r\n\t        // see available options below\r\n\t        $formMapper\r\n\t            ->add('name')\r\n\t            ->add('description', null, array(\r\n\t                'required' => false,\r\n\t                'label' => 'description'\r\n\t            ))\r\n\t            ->add('command_alias', 'sonata_type_model_list', array(\r\n\t                'btn_add'       => 'add',\r\n\t                'btn_list'      => 'list',\r\n\t                'btn_delete'    => 'delete'\r\n\t            ), array(\r\n\t                'multiple' => true,\r\n\t                'expanded' => true\r\n\t            ))\r\n\t            ->add('active', null, array(\r\n\t                'required' => false,\r\n\t                'label' => 'active'\r\n\t            ));\r\n\t    }\r\n\r\n\t    ...\r\n\t}\r\n```\r\nCan any give me some advice? What I am doing wrong? Is this not ready yet?\r\n"},"comment":{"url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/issues/comments/167599127","html_url":"https://github.com/sonata-project/SonataAdminBundle/issues/3508#issuecomment-167599127","issue_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/issues/3508","id":167599127,"user":{"login":"tim96","id":12379114,"avatar_url":"https://avatars.githubusercontent.com/u/12379114?v=3","gravatar_id":"","url":"https://api.github.com/users/tim96","html_url":"https://github.com/tim96","followers_url":"https://api.github.com/users/tim96/followers","following_url":"https://api.github.com/users/tim96/following{/other_user}","gists_url":"https://api.github.com/users/tim96/gists{/gist_id}","starred_url":"https://api.github.com/users/tim96/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tim96/subscriptions","organizations_url":"https://api.github.com/users/tim96/orgs","repos_url":"https://api.github.com/users/tim96/repos","events_url":"https://api.github.com/users/tim96/events{/privacy}","received_events_url":"https://api.github.com/users/tim96/received_events","type":"User","site_admin":false},"created_at":"2015-12-28T16:27:56Z","updated_at":"2015-12-28T16:27:56Z","body":"@reypm  maybe ModelChoiceLoader is not ready? https://github.com/sonata-project/SonataAdminBundle/pull/3504/files"}}