How convert it to Doctrine QueryBuilder?
SELECT A.*
,(SELECT COUNT(created_on)
FROM event WHERE DATE=created_on) created
,(SELECT COUNT(updated_on)
FROM event WHERE DATE=updated_on) updated
FROM (
SELECT created_on DATE FROM event
UNION SELECT updated_on FROM event ) A
DQL does not support subqueries in the
SELECTclause, nor theUNIONclause. Please check DQL’s EBNF to see what the supported features are. Consider using Native SQL if your query needs this degree of complexity.