you could intercept using a beforeSave callback.

If a date field is found to be empty set it to null. or remove it
entirely from the array and make sure your field has default set to
null.

HTH,
mikee

On 30/11/06, Rodrigo Tassinari <[EMAIL PROTECTED]> wrote:
>
> Hello all,
>
> I'm using the HtmlHelper to generate selects to fill some datetime and
> time fields in my database. The problem is that when a form is saved
> with these fields set to empty (ie, nothing selected on the selects),
> Cake is inserting 0000-00-00 00:00:00 in the datetime fields (and
> 00:00:00 on the time fields), instead of NULL, which I prefer.
>
> Is there anyway around this? I really wanted NULL values when the user
> didn't fill that field...
>
> Thanks,
> Rodrigo.
>
>
> >
>

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