There is a (closed) trac for it here:
https://trac.cakephp.org/ticket/648

I have a simple setup, Category hasMany Product, and need to add
additional info to the array when I find something. My afterFind
method follows

        function afterFind($results) {
                // print_r($results)    -  was using this for debugging
                for($i = 0; $i < count($results); $i++) {
                                $results[$i][$this->name]['thumbnail'] = $this-
>get_thumbnail($results[$i][$this->name]['id']);
                                $results[$i][$this->name]['images'] = $this-
>get_images($results[$i][$this->name]['id']);
                                $results[$i][$this->name]['base'] = $this-
>get_base_url($results[$i][$this->name]['id']);
                }

                return $results;
        }

$this->Product->findAll() works fine, but $this->Category->findAll()
gives me A LOT of warnings. Browsing thorugh the print_r output, I
found something like

Array
(
    [0] => Array
        (
            [id] => 2
            [category_id] => 10
            [code] => 1234
            [title] => testeee
            [description] => asdfasd
        )

)

No [Model] anywhere! The [nasty] workaround was adding

if(empty($results[$i][$this->name]['id'])) break;

inside the foreach() on afterFind ... any chance this will get fixed
on 1.1 ?


Thanks


gui


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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