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

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜