0

In my data model I have two entities: "Companies" and "Clients". Companies represent companies I own and Clients are my clients. All Companies and Clients should have their own user account to login. Reading about Symfony2's security I created this model where Companies and Clients extend the User object that Symfony2 needs for Security.

My question is: will this work in the Symfony2 security framework with authentication and authorization? Also, is this the common way to model the data if you have multiple entities that map to a user?

enter image description here

Wouter J
  • 41,455
  • 15
  • 107
  • 112
BigJ
  • 1,990
  • 2
  • 29
  • 47

1 Answers1

1

This should work because the different authenticator out there use the "is instance of BaseUserClass" . And it seems quite logical to do the way you're doing.

allan.simon
  • 3,886
  • 6
  • 35
  • 60