2011-03-27 79 views
0

我發現在控制檯中編寫dql語句非常方便。 例如,控制檯dql連接語法?

./symfony doctrine:dql "from sfGuardUser where id = 8" 

不過,無論我嘗試我似乎無法正確地書寫一個連接查詢。我會喜歡它的工作:

./symfony doctrine:dql "from sfGuardUser s left join s.Profile" 

但它沒有。什麼是正確的語法?

回答

0

我剛剛試過了,我只能得到一個正常的連接工作(不是左連接)。

在這種情況下,正常的連接是足夠好的。 (One user has one profile)

./symfony doctrine:dql "from sfGuardUser s join s.Profile" 
+0

謝謝!事實上,它就像一個左連接(缺失關係返回爲空)。 – Dziamid 2011-03-27 20:34:50