 <p>You forgot to add the <code>@ORM\</code> prefix in your annotations:</p> <pre><code>/** * @ManyToMany(targetEntity="User", mappedBy="hasAccessToMe") **/ </code></pre> <p>should be</p> <pre><code>/** * @ORM\ManyToMany(targetEntity="User", mappedBy="hasAccessToMe") **/ </code></pre>