2014-01-27 25 views
0

我正在使用FOSUserBundle,SonataUserBundle。這裏是我的代碼,如何訪問用戶表FOSUserBundle SonataUserBundle

https://github.com/vishalmelmatti/FOSSonataUserFacebookIntegration

我有3個選項,用於訪問用戶表,

1)創建UsersRepository在https://github.com/vishalmelmatti/FOSSonataUserFacebookIntegration/tree/master/src/Application/Sonata/UserBundle/Entity

2)擴展FOSUserBundle的FOS \ UserBundle \原則\的UserManager並添加我的方法。

3)延長FOS \ UserBundle \安全\ UserProvider並添加我的方法,它這intenally訪問類2

什麼是最好的辦法產生的?

回答

0

存儲庫方法聽起來對我來說是最好的,因爲它是與「數據庫」操作有關的實體相關/特定邏輯,而存儲庫是正確的做法。

這是相當好的explained in the docs

相關問題