On Thu, Mar 12, 2009 at 5:08 AM, gunung pangrango wrote:
> Hello,
>
> I'm new in cakephp and now i have one problem
>
> i have one model with nested associated with other model
> example:
>
> A -> hasMany B
> B -> hasMany C
> C -> hasMany D
> C -> hasMany E
>
> and if i call associated of A then the return result is
>
> Array
> (
> [A] => Array
> (
> [B] => Array
> (
> [C] => Array
> (
> [0] =>[D]
> [1] =>[E]
> )
> )
> )
> )
>
> how to retrieving list of all models associated with a given modell..??
I'll bet there's a simpler way but you could always run through:
$this->A->hasMany
$this->A->belongsTo
etc.
You'd want to abstract it with a loop through each of A's
associations, then through those, basically:
$this->{$assoc}
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---