Shit, i've made mistake on describing the resulting array. Of course all arrays (new, assigned, editing) are sub-arrays of [0]. sorry for the mixup
Faza pisze: > Hi all, > > more newbie questions on the way. > > I have few models related (mostly $belongsTo), and one of them requires a > level 3 recursion, which is not-a-very-good practice. Especially that > enabling lvl 3 recursion gathers much more data from the model than I really > need. > > Therefore I thought that I could extend the model using some function to get > the data I need, and then merge it with the result of findAll. > > The problem is, I don't have a clue where to start. > > 1st of all, how to make Cake run my function each iteration of the "foreach > $results as $result"? I need this, because - obviously - I have to pass the > id of each row to the function. > > 2nd, the function will return a leveled array, like this: > > Array > ( > [0] => Array > ( > [New] => Array > ( > Since => 2009-04-20, > Changer => John Doe > ) > [1] => Array > ( > [Assigned] => Array > ( > Since => 2009-04-22, > Changer => Ed Smith > ) > > [3] => Array > ( > [Editing] => Array > ( > Since => 2009-04-23, > Changer => Mark Adams > ) > > ) > > etc etc > > What I want to get, is that result of findAll will be expanded with the above > fields. > > Plz bear with my newbieness and ask away if there's something I didn't > describe good enough to be understood. > > Thanks in advance. > > > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
