Logically following your hierarchy, I would setup the model
relationships as follows:

School hasMany Parents
Parents belongTo School

Parents hasMany Kids
Kids belongTo Parents

Using these relations, accessing the School model would give you
access to the Parents assigned to that School and the Kids assigned to
that Parent. You can then use 'recursive' if you only want to retrieve
Parent info.


On May 15, 6:19 pm, hahmadi82 <[email protected]> wrote:
> Hi, I'm new to cakephp and I'm confused about the model setup...
>
> I have class kids "belongsTo" parents and class school "hasMany" kids.  Now
> in my index for kids I can retrieve all parent information based on the
> foreign key. However in school, i have access to the kid information but not
> the parents info that belongs to the kids.  Does this belongsTo info not
> pass along parent info to the school class? If so, I have trouble setting it
> up...
>
> Please let me know if you need the actual code snippet and I will gladly
> paste.
> --
> View this message in 
> context:http://www.nabble.com/Problems-with-belongTo-and-hasMany-tp23567941p2...
> Sent from the CakePHP mailing list archive at Nabble.com.
--~--~---------~--~----~------------~-------~--~----~
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