Hi all,
Is this the best way to create a calculated field in a model object?
It works perfectly, but having to merge an array doesn't seem ideal,
and it's not OO at all.
function afterFind($results)
{
for ($i=0; $i < count($results); $i++) {
$lens = $results[$i]['Lens'];
$description = $lens['wide_zoom'] . '-' .
$lens['long_zoom'];
$lens = array_merge($lens, array('description' =>
$description));
$results[$i]['Lens'] = $lens;
}
return $results;
}
Many thanks
Tim
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---