DQL クエリを作成しようとしていますが、このエラーが発生し続けます。
[Semantical Error] line 0, col 68 near 'r': Error: Class Custom\SystemBundle\Entity\Element has no association named CustomAuthBundle:Role
これらのエンティティのコードは次のようになります。
役割:
/**
* @ORM\ManyToMany(targetEntity="Custom\SystemBundle\Entity\Element", mappedBy="role_id")
*/
private $element_id;
エレメント:
/**
* @ORM\ManyToMany(targetEntity="Custom\AuthBundle\Entity\Role", inversedBy="element_id")
*/
private $role_id;
そして、ここにクエリがあります:
php app/console doctrine:query:dql 'SELECT e FROM CustomSystemBundle:Element e JOIN e.CustomAuthBundle:Role r'