What is the difference between JOIN ON and JOIN WITH in Doctrine2?
I couldn't find any relevant info in the manual.
ON
replaces the original join condition,WITH
adds a condition to it.
Example:
[Album] ---OneToMany---> [Track]
Case One
DQL
FROM Album a LEFT JOIN a.Track t WITH t.status = 1
Will translate in SQL
FROM Album a LEFT JOIN Track t ON t.album_id = a.id AND t.status = 1
Case Two
DQL
FROM Album a LEFT JOIN a.Track t ON t.status = 1
Will translate in SQL
FROM Album a LEFT JOIN Track t ON t.status = 1
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