Is it possible to create a hierarchy of model classes? Cake doesn't
seem too happy when I try.

What I mean is that I have a table, let's say "People". I've created
two models which use this table, let's say "Man" and "Woman". The
reason they're different is that they have different validation rules,
business rules, controllers, etc.

So far so good, but now I have a child object type, say a "Hat". A hat
"belogsTo" a "Man" OR a "Woman" through a "person_id" foreign key. I
assumed I could have the "Man" and "Woman" model classes extend a
"Person" class, which would extend AppModel and define the belongsTo
relationship. However this doesn't work.

Is there an easy solution to this type of problem? I want to avoid
separate "ManHat" and "WomanHat" models for obvious reasons. I also
want to avoid separate tables for Men and Women since they really are
the same thing.

Any advice is appreciated.
Best Regards...


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to