Hello.
i have 2 models, linked together by a HABTM relationship.
The 2nd model has a function that formats some fields after the data
is loaded.
Why is this function not working if i load data from the HABTM
relationship?
is there any better way to make this work?
Here's an example
NOTE: this code is for example purpose only. Don't look @ typos :)
class Car extends AppModel {
var $name = "Car";
var $hasAndBelongsToMany = array(
"Passenger" => array(
"className" => "Passenger"
)
);
}
class Passenger extends AppModel {
var $name = "Passenger";
function afterFind($results, $primary = false) {
$results["Passenger"]["Name"] = strtoupper($results["Passenger"]
["Name"]);
return $results;
}
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" 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
-~----------~----~----~----~------~----~------~--~---