Re: find('all') with results using id as the index instead of 0,1,2,3,...

2014-10-29 Thread glk
Thank you Dario... The longer I work with Cake, the more cool stuff I find within! -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To unsubscri

Re: find('all') with results using id as the index instead of 0,1,2,3,...

2014-10-19 Thread Dario Savella
I think Hash could be of help. Something like: $new = Hash::combine($result, '{n}.id', '{n}.otherdata'); -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP ---

find('all') with results using id as the index instead of 0,1,2,3,...

2014-10-18 Thread glk
Hello, I seem to be rewriting the same code over and over... which, of course, is really a waste of time... What I'm using a lot is the results of a find all that is indexed by the id field. find all returns: [0] => array( id => 178, otherdata => 'something 178') [1] => array(id => 55, otherda