Cakephp Autoconvert find() fields?
- by Razor Storm
In cake php I can grab a model's fields by using the find() method. What if I wish to apply a transformation function to the fields? Is there a way to directly accomplish this task?
Suppose I have a model called RaceTime with the fields racerId and timeMillis
RaceTime
+------------+
| Field |
+------------+
| id |
| racerId |
| timeMillis |
+------------+
timeMillis is an int specifying how long the race took in milliseconds. Obviously saying a race took 15651 milliseconds isn't very useful to a human reader, and I would wish to convert this to a human readable format.
Is there a way to accomplish this directly in find()?
Or is the only option to loop through the results after find() finishes?