I have the following (exemplary) query:
SELECT *
FROM User u
LEFT JOIN section_user su ON (su.user_id = u.id AND su.section_id = 3)
WHERE section_id is null
I am trying to rebuild it in Symfony2 on a many-to-many relationship between users and sections with query builder but I am failing.
I thought it would look like this, which proves to be wrong:
$er->createQueryBuilder('u')
->leftJoin('u.sections', 's', 'WITH', 's = :section')
->where('s is null')
->setParameter('section', $section);
Help is very appreciated!
NULL
if it's not 3. – Khiva