I have the following query and would like to know how to write it using doctrine 2 (dql):
SELECT *
FROM mtc.evt_event AS e
INNER JOIN gen_category AS gc ON e.gen_category_id = gc.id
WHERE EXISTS
(SELECT *
FROM evt_user_ticket_rel AS etr
JOIN evt_event_ticket AS et ON et.id = etr.evt_event_ticket_id
WHERE etr.gen_user_id = 8
AND e.id = et.evt_event_id
AND et.nrorg = 1)
UNION
SELECT *
FROM mtc.evt_event AS e
INNER JOIN gen_category AS gc ON e.gen_category_id = gc.id
WHERE EXISTS
(SELECT *
FROM evt_event_favorite AS ef
WHERE gen_user_id = 8
AND ef.evt_event_id = e.id
AND ef.nrorg = 1);