0

I wondering about this line

->leftJoin(
    'AppBundle\Entity\UserGroups',
    'UserGroups',
    \Doctrine\ORM\Query\Expr\Join::WITH,
    'User.group_id = UserGroups.id'
);

This works fine, the result is okay.

But when I replace ::WITH with ::ON this causes an error:

Error: Expected Doctrine\ORM\Query\Lexer::T_WITH, got 'ON'

So what are difference between ::WITH and ::ON ?

Jason Roman
  • 8,146
  • 10
  • 35
  • 40
Thomas Banderas
  • 1,681
  • 1
  • 21
  • 43

1 Answers1

1

Look here:

https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Query/Lexer.php

T_ON is not even a valid constant inside Doctrine's Lexer class, which is why you are seeing the error.

Jason Roman
  • 8,146
  • 10
  • 35
  • 40