I’m trying to make a DQL query, which keeps giving me this error:
[Semantical Error] line 0, col 68 near 'r': Error: Class Custom\SystemBundle\Entity\Element has no association named CustomAuthBundle:Role
The code for these Entities look like this:
Role:
/**
* @ORM\ManyToMany(targetEntity="Custom\SystemBundle\Entity\Element", mappedBy="role_id")
*/
private $element_id;
Element:
/**
* @ORM\ManyToMany(targetEntity="Custom\AuthBundle\Entity\Role", inversedBy="element_id")
*/
private $role_id;
And here is the query:
php app/console doctrine:query:dql 'SELECT e FROM CustomSystemBundle:Element e JOIN e.CustomAuthBundle:Role r'
role_idorelement_id. Objects will be stored there, not their identifiers. Soabc_id→abc.Assocations are defined by properties, not classnames: