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 [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