I'm currently using Symfony2 and doctrine. and I'm working on a "create-account" page. There will be 2 different kinds of accounts avaliable on the page, one for normal-users
and one for companies
.
I've got an entity (table) called Account
this table contains the username
, password
and salt
columns.
If a company logs in I want to have the company information from a company
-table and if a normal-user
logs in I want the information from the user
-table.
I've been thinking about having a column named usertype
which tells me what type it is, then if the usertype is a company
retrieve the company-information-entity and if it's a user
retrieve the user-information-entity (corresponding to the id
of the account).
Is this a good way to solve this problem? or should I have 2 different tables? AccountUser and AccountCompany?