For example if you want to get all children of United States (with id
= 1):
$locations = Location->find('threaded', array('condition' => array
('id' => $id)));
For further reference, look at http://book.cakephp.org/view/73/Retrieving-Your-Data#find-threaded-812
On Dec 23, 6:54 am, Michael Gaiser <mjgai...@gmail.com> wrote:
> So I have a model setup where a location can link to itself as a parent.
> (states and cities are all locations, San Francisco would have the
> California set to its parent_id). Now my issue is that I am trying to build
> a function that when given a location id, it will return an array of all the
> children id's. For my find call, I am having to nest the same call over and
> over inside the containable array because we can have up to 4 levels of
> children. (World, National, Regional, City, Landmark). Is there a better way
> to do this?
>
> ~Michael
Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
No comments:
Post a Comment