How I could check if the alias is already defined?
There is no method for check this.
Thats not working because I got only the ROOT alias and no join aliases.
/** @var $query \Doctrine\ORM\QueryBuilder */
$query->getRootAliases()
The parts is another invalid option for me...
$query->getDQLPart()
Returns only the parts like "select, from, etc.".
And thats the error I would "ignore".
[Semantical Error] line 0, col 254 near '_user LEFT': Error: '_user' is already defined.
How could I check if the alias exists?