FOSUserBundle or PUGXMultiUserBundle to have two different user profiles (Symfony2)

前端 未结 1 1121
礼貌的吻别
礼貌的吻别 2021-01-01 05:24

I\'m doubtful about how to approach this problem:

My Symfony2 app for this issue has two different profiles, name \'em \"Seller\" and \"Buyer\". The goal is to keep

相关标签:
1条回答
  • 2021-01-01 05:37

    I would definitely use the PUGXMultiUserBundle for that. I don't think it's a hack, it just implements a discrimination table that will be like:

    1User Table

    ----------------------------------------
    | id  | username  |  type  |------------
    |-----|-----------|--------|------------
    |  1  |  mgdepoo  | buyer  |------------
    |  2  | Sydney_o9 | seller |------------
    ----------------------------------------
    

    2Buyer Table

    ----------------------------------------
    | id  |  buyer_specific_field_1
    |-----|---------------------------------
    |  1  |  
    ----------------------------------------
    

    3Seller Table

    ----------------------------------------
    | id  |  seller_specific_field_1
    |-----|---------------------------------
    |  2  |  
    ----------------------------------------
    

    That's all there is really.

    I think that's exactly what you need especially if you wish to have different profiles for your users. You will have 2 registration forms as well (but you can make one with a choice box buyer/seller if you want to).

    I personally use this bundle and it works great for me. Now, one of the question you might want to ask yourself is what if a buyer wants to be a seller as well. Does he want to have another email address? That is a choice that you'll have to make.

    0 讨论(0)
提交回复
热议问题