, >, >=, !=, got \'.\'\"" />
开发者

Doctrine DQL Can I not dot into related objects? eg. todo.todoList.project

开发者 https://www.devze.com 2023-02-05 18:03 出处:网络
I think I am getting the error \"[Syntax Error] line 0, col 194: Error: Expected =, <, <=, <>, >, >=, !=, got \'.\'\"

I think I am getting the error "[Syntax Error] line 0, col 194: Error: Expected =, <, <=, <>, >, >=, !=, got '.'"

Because my DQL is invalid (3rd line)?

SELECT COUNT(t.id) AS numTasks, COUN开发者_开发技巧T(t.completedOn) AS numCompleted
FROM Application\Models\Todo t
WHERE t.todoList.project = :proj  
AND t.assigned = :user

How can I drill down into related elements? A Project have TodoLists, TodoLists have Todos. So I am trying to get the total number of todos & completed todos where the todo comes from the specified project


Use an explicit LEFT JOIN or INNER JOIN. That would have been done under the hood anyways.

0

精彩评论

暂无评论...
验证码 换一张
取 消