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?
You could use PHP native in_array
function to check if the value exists in the array or not.
in_array($alias, $qb->getAllAliases())
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With