PS In simpler terms my question is, if one Model inherits from
another, should I be able to override $hasMany in the child class?

On May 20, 2:58 pm, toby1kenobi <[email protected]> wrote:
> Hi there,
>
>   I am using the excellent ExtendableBehaviour (http://tinyurl.com/
> extendablebehaviour) in my implementation of single-table inheritance.
> In my sub-classes of my base model I have tried to re-declare
> $hasMany, which is different for my various child classes. However,
> the $hasMany actually never changes from what's set in my base class -
> does anyone know whether this is to be expected, or have a messed
> something else up?
>
>   By way of a very simple example (the value of SuperContentItem-
>
> >hasMany remains the same as for ContentItem):
>
> class ContentItem extends AppModel {
>
>     var $name = 'ContentItem';
>
>     var $hasMany = array(
>                         'Address' => [details...]
>         )
>     );
>
> }
>
> class SuperContentItem extends ContentItem {
>
>     var $name = 'SuperContentItem ';
>     var $actsAs = array('Extendable');
>     var $useTable = 'content_items';
>
>     var $hasMany = array(
>                         'Address' => array([details...]),
>                         'AnotherThing' => array([details...])
>         )
>     );
>
> }
>
>   Thanks for any help, it's always appreciated.
>
> Toby
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to