Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between WITH and ON in Doctrine Join condition type?

I'm searching for a better explanation about the difference between WITH and ON condition type for the doctrine clausure.

I'm finding the documentation about this very poor and I'm still in doubt.

like image 874
mayconfsbrito Avatar asked Sep 29 '14 14:09

mayconfsbrito


1 Answers

In my opinion it's kind of a left over from doctrine 1.

Back then ON was used to redefine the join conditions of relations, whereas WITH was used to add more join conditions to the default one.

Now in doctrine 2 I have never seen a situation where ON can be used. In fact using ON always ends up in an exception saying you should use WITH.

Right now WITH can be used to add join conditions to the default one defined in a relation or, if no relation exists between two entities, define the join condition.

like image 167
SBH Avatar answered Sep 30 '22 12:09

SBH