0
在我的應用程序(與Symfony 1.4和Doctrine開發),我試圖讓所有用戶基於idempresa
的用戶登錄。idempresa
是在sf_guard_user_profile
表中,這是模式爲:堅持試圖讓只有用戶idempresa
SfGuardUserProfile:
connection: doctrine
tableName: sf_guard_user_profile
columns:
id: { type: integer(8), primary: true }
user_id: { type: integer(8), primary: false }
idempresa: { type: integer(4), primary: false }
relations:
User:
local: user_id
class: sfGuardUser
type: one
foreignType: one
foreignAlias: SfGuardUserProfile
onDelete: CASCADE
onUpdate: CASCADE
我試圖與此查詢:
Doctrine_Core::getTable('sfGuardUser')
->createQuery('u')
->leftJoin('u.Profile p')
->where('idempresa = ?', $id_empresa)
->execute();
但得到這個錯誤:
Unknown relation alias Profile
我的代碼有什麼問題?
我敢肯定,我嘗試但不工作,也許一個錯字,我累了凌晨2點,反正感謝 – Reynier
這絕對是樂趣編寫代碼凌晨2點,但你很容易陷入這樣簡單的錯誤。 ;) –