I’m guessing this is a common need.
I have a user table in MySQL that I use for authentication and authorization.
ON login, I save the ‘company_code’ that each user is associated with.
This can be then accessed as ‘Yii::app()->user->user_company_code’
For all subsequent retrievals from the system’s several tables (each of which has a ‘company_code’ value),
I want a WHERE clause item to secretly add:
. . . WHERE table_name.company_code = ‘Yii::app()->user->user_company_code’
My question is: where is the best place to add that feature?
Thanks.