I need to properly configure this model relationship and was looking for
some insight.

 

Basically :

Company hasMany Employees

Company hasMany Contracts

 

I need to allow the administrator for that Company to assign a Contract to
and Employee 

So Employee hasMany Contracts but the Contract <-> Company, what is the best
way to relate the Contract <-> Employee in the database with relations?

 

Build a separate table employees_contracts with id, contract_id,
employer_id, employee_id? 

But how to link employee to contract without having a employee_id in the
contract table?

 

Ideally the Employee logs in and they see the set of Contracts assigned to
them, without having to actually have employee_id in the Contract table
since it really belongs to the Company.

 

Any tips would be great.

 

Thanks,

 

Dave

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to