Wednesday, June 26, 2013

Re: Model::AfterFind $results format, associations



On Tuesday, 25 June 2013 20:21:54 UTC+2, Vanja Dizdarević wrote:
As many have failed before me, I am trying to massage some data in the afterFind callback in CakePHP 2.3.6.

 public function afterFind($results, $primary = false) {
        $results = parent::afterFind($results, $primary);
        foreach ($results as $key => $val) {
              //... do stuff
        }
        return $results;
    }

But, as I have seen in many examples on the web, there are many different formats that can be expected in the $results array, d

what are these multiple formats that you refer to - and what is your afterFind method going to do?

Sounds like you might be expecting a problem that doesn't exist (if you have a specific example - please show it).

AD

--
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 unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments: