I think the best way for you is to create a TransformField behavior,
and override afterFind (to populate 'title' in array) and beforeSave
(to change 'title' to 'FP002EX' in UPDATE) in it.
If it's just for one table, directly override them in your model.
Maybe you'll need to override other callbacks too, check API:
http://api.cakephp.org/1.2/class_model_behavior.html

On Nov 12, 8:22 am, mmalca <[EMAIL PROTECTED]> wrote:
> Iam looking for a way to transform column names (behaviour perhaps?).
> I have an existing database with very confusing column names (like
> FP002EX - remember Fortran) and would like to display/use/edit them in
> cakephp via friendlier name: eg FP002EX -> title
>
> Something like:
>
> class MyModel extends AppModel {
> var $actsAs = array('transnames');
> var $transNames = array('FP002EX'=>'title',...);
>
> }
>
> controller usage:
> $this->data['MyModel']['title'] = 'New title'; // would set FP002EX
> $this->save($this->data);
>
> Is there an existing solution to my problem? Can someone point me to
> the best way for implementing this behaviour?
> Tnx


--~--~---------~--~----~------------~-------~--~----~
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