07-20-2023, 05:33 AM
Hy guys,
I decided to use FOSUserBundle for handling user authentication in my application.
In my application, companies can register their details (name, address, etc).
So I decided to create an entity called Company to hold the company related data and an entity called User to keep the user data from FOSUserBundle separately.
I started to override the default registration form as it is described in the documentation [Overriding Default FOSUserBundle Forms][1], but the problem is that I can't add my fields from Company to the form, it always try to access from the User entity (propably because that one is related to FOSUserBundle).
Is there any way to put the Company entity fields in the FOSUser registration form?
I don't want to mess up the data model by using the Company as the base entity for FOSUser and adding to it all the fields (username, email, password, etc).
Best regards,
[1]:
I decided to use FOSUserBundle for handling user authentication in my application.
In my application, companies can register their details (name, address, etc).
So I decided to create an entity called Company to hold the company related data and an entity called User to keep the user data from FOSUserBundle separately.
I started to override the default registration form as it is described in the documentation [Overriding Default FOSUserBundle Forms][1], but the problem is that I can't add my fields from Company to the form, it always try to access from the User entity (propably because that one is related to FOSUserBundle).
Is there any way to put the Company entity fields in the FOSUser registration form?
I don't want to mess up the data model by using the Company as the base entity for FOSUser and adding to it all the fields (username, email, password, etc).
Best regards,
[1]:
[To see links please register here]