Right. Thanks for that.
So to make this work with the relations you out lined below if I add employee_id to the posts table , creates employees tables with investor_id post_id that should do it for db changes? Add the employees controller/model and add the relationshis to the other models Investor / Posts. Thanks again. Dave -----Original Message----- From: John Andersen [mailto:[email protected]] Sent: June-11-09 2:43 AM To: CakePHP Subject: Re: Relationship question Hi Dave, On the assumption, that one post will only be handled by one employee, the following relationships would be required: > Investor hasMany Posts > Investor hasMany Employees > Employee (handles) hasMany Posts > Post belongsTo Investor > Post belongsTo (is handled by) Employee (the Handler) I do not see a need for the relationship: > Post hasOne Investor My understanding of the "hasOne" relationship, is that the foreignkey then is at the Investor end, which I assume is not the case, but maybe you can clarify that? Enjoy, John On Jun 10, 7:00 pm, "Dave Maharaj :: WidePixels.com" <[email protected]> wrote: > I want to add to an app a new function. Basically I have Investors > that hasMany Posts. Nothing crazy there.... > Now I want to add Employees that belongTo Investors so an Investor > company can if they choose add employees to manage different Posts . > So if an Investor company has 35 Posts they can add an employee(s) and > say employee1 will handle Post3, employee2 will handle Post 5,6,7 soon and so on.... > > Right now the Investor hasMany Posts so to expand this idea I cant > figure out how Post <-> Employee Relationship would be Investor > hasMany Posts Investor hasMany Employees Employee hasMany Posts Post > belongsTo Investor Post hasOne Investor > > Ideas? > > Dave --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---
