Thanks a lot its working now :-)

On 6/22/07, Grant Cox <[EMAIL PROTECTED]> wrote:
>
>
> Well, the inbuilt behaviour is hard-coded to "created", "modified" and
> "updated".  However, you can easily throw a beforeSave() in your
> model, check if an id is already set (indicating UPDATE rather than
> INSERT) and set your data yourself.
>
>         function beforeSave()
>         {
>                 if ( empty($this->id) and
> empty($this->data[$this->name]['id']) ){
>                         // inserting a new row
>                         $this->data[$this->name]['TBP_Created_Dt'] =
> date('Y-m-d H:i:s');
>                 }
>                 $this->data[$this->name]['TBP_Modified_Dt'] = date('Y-m-d
> H:i:s');
>                 return parent::beforeSave();
>         }
>
> This can go in a single model, or in your AppModel to apply to all.
>
>
> >
>


-- 
Thanks & Regards
Sridhar Kuppalli
Bangalore
[EMAIL PROTECTED]

"Behind Every Great Fortune There is a Crime"

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