Hi there, If you play around with Set::combine and Set::extract a bit you could achieve the desired results. As I know for a fact that you're a fellow brazilian, take a look at this blog post: http://kiss.souagil.com.br/2008/08/manipulando-arrays-associativas/
I hope it'll help you. Cheers, Gabriel Gilini www.usosim.com.br [EMAIL PROTECTED] [EMAIL PROTECTED] On Thu, Oct 9, 2008 at 10:41 AM, SamuraiDio <[EMAIL PROTECTED]> wrote: > > Hi... > A friend of mine is developing an application with uses a recursive > hasMany association in a Model. > Everything is working fine, except that the obtained data array is > ugly, and dificult to work on. > > This is the Model definition: > > class PlanoConta extends AppModel { > var $name = 'PlanoConta'; > var $displayField = 'nome'; > var $hasMany = array( > 'PlanoContaFilho' => array( > 'className' => 'PlanoConta', > 'foreignKey' => 'parent_id' > ) > ); > } > > Using a > find('all' array('recursive' = 3)); //omiting irrelevant option... > The resultset is like this: > > http://pastebin.com/m354d1d17 > > But it would be better to obtain something like this: > > http://pastebin.com/f31071d88 > > Is it possible to obtain a resultset like this? > > > > --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---