http://book.cakephp.org/view/1046/Multiple-relations-to-the-same-model
Jeremy Burns
Class Outfit
jeremybu...@classoutfit.com
http://www.classoutfit.com
On 27 Jun 2010, at 13:13, jtomka wrote:
> Hey guys,
>
> I'm new to CakePHP and already stuck. I'm trying to use a common
> "contact" table and multiple tables, each referencing it one or more
> times.
>
> The schema goes something like this:
> contacts (id, name, address, phone, email)
> practice_sites (id, title, contact_id)
> practitioners (id, contact_id, qualifications)
> clients (id, contact_id, emergency_id, guardian_id) // each
> referencing the contact table
>
> Now how do I define relationships between the common contact table and
> each of the remaining ones? I'd love to be able to say "practice_site
> hasone contact", "practitioner hasone contact", "client hasone
> contact".
>
> Related to my schema design, is there a (generic, reusable) way to
> make the "contact" record creation/update a part of creation/update of
> a record referencing it? E.g. client add/edit form containing the
> contact table fields (as opposed to scaffolding's reference dropdown)?
>
> Cheers,
> Jan
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
Check out the new CakePHP Questions site http://cakeqs.org and help others with
their CakePHP related questions.
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en