I have a select with SQL which is working perfectly, but I cannot translate this query to DQL with createQueryBuilder()
.
Here's my query:
SELECT distinct c.name_id
FROM cultures AS c
LEFT JOIN ilots AS i ON i.exploitation_id = 1
My current code:
return $this->createQueryBuilder('c')
->leftJoin(Ilots::class, 'i', 'ON', 'i.exploitation = 1')
->distinct()
->getQuery()
->getResult();
And the error:
[Syntax Error] line 0, col 74: Error: Expected end of string, got 'ON'