title: Role Interface and Manage Roles
body: <p>I have simple UserInterface entity:</p>
  
  <pre><code>function getRoles()
  {
      return $this-&gt;roles-&gt;toArray();
  }
  </code></pre>
  
  <p>and with many to many relation with Role Entity interface</p>
  
  <pre><code>/**
  * @ORM\ManyToMany(targetEntity="Role", inversedBy="users", cascade={"persist"})
  */
  protected $roles;
  </code></pre>
  
  <p>When I try to manage user roles with form Type</p>
  
  <pre><code>public function buildForm(FormBuilder $builder, array $options)
  {
      $builder-&gt;add('roles');
  }
  </code></pre>
  
  <p>Symfony returns me an error:</p>
  
  <blockquote>
    <p>Expected argument of type "Doctrine\Common\Collections\Collection",
    "array" given</p>
  </blockquote>
  
  <p>I know the error is in the getRoles method of the entity User that returns an array but I also know getRoles is a method of the interface and must return an array!</p>
  
  <p>Anyone have a good solution?</p>