Moving this one along a bit....

I've tried every which way to get this one to work, and I'm stumped.

Using afterFind on info from one table works just fine; putting this
in the Player model:

    function afterFind($results) {
         foreach ($results as $key => $val) {
            $results[$key]['Player']['fullname'] =
$val['Player']['fname'] . ' ' . $val['Player']['lname'];
        }
        return $results;
    }

lets me use 'fullname' in controllers easily enough.

How do I get something from another table to concat nicely.

Code like

    function afterFind($results) {
         foreach ($results as $key => $val) {
            $results[$key]['Team']['teamsport'] =
$val['Team']['team'] . ' ' . $val['Sport']['sport'];
        }
        return $results;
    }


only gets me the field from the Team table when it's in the Team
model, and throws a Notice: Undefined index: Sport in...blahblahblah
error.

Team belongsto Sport, Sport hasmany Team


What kinda hoops do I need to jump threw to get this info in a Cake-y
manner? I need to generate a select in another controller. If
somebody'd hold my hand on this one, it'd be greatly appreciated...

Thanks!


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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