Your inheritance hierarchy is entirely correct. The answer to your
question about the name vs table question is "it depends".

If you have at any point explicitly set the table name field
(useTable) or the name field (name), then these will be inherited by
your child class and the model will use them, rather than its default
which is to reflect the name of the class on which the model instance
is based.

What I would recommend is that your use the inheritance model you
suggest, but explicitly set the table in both parent and child models,
using the useTable variable, this will make sure you don't have any
conflicts.

Simon

On Jul 2, 3:26 pm, M <[EMAIL PROTECTED]> wrote:
> Hello,
> suppose that I have a class (room) with certain attributes, and
> another class (shop) that is a special kind of room, and should have
> the same methods of room (but some has to be overridden) and some more
> attributes than base class room.
>
> I have some question on how to implement/model this in a php5/cakephp
> environment.
> Sorry if these are newbie questions, if there is any document that
> clarifies this, please give me a pointer.
>
> a) i think that shop should extend the class room, but will cakephp
> try to save/read data to a table called rooms or it will search a
> table called shops?
>
> b) In case the referred table will be the rooms table, shall i Create
> all the extra attributes the class shop has? What if I have ten
> different "special rooms" each one with different attributes?
>
> Thanks
>
> --Michele


--~--~---------~--~----~------------~-------~--~----~
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