For Programmers: Free Programming Magazines  


Home > Archive > PHP Pear > September 2007 > Re: [PEAR] Re: DB_DataObject_FormBuilder set datefield default to null









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: [PEAR] Re: DB_DataObject_FormBuilder set datefield default to null
Luca Giandoso

2007-09-18, 8:02 am

On 9/18/07, nik600 <nik600@gmail.com> wrote:
> thanks to your reply.
>
> I've already read the documentatio, mayme i miss understand something.
>
> I try to explain you what i'm trying to do:
>
> - i want that when i create a new record having a field of type
> datatime, the default values in the select are set to 0000-00-00
> 00:00:00 instead of the current time.
>
> - when i edit a record that has the field value set to null or
> 0000-00-00 00:00:00 the default values in the selece are still set to
> 0000-00-00 00:00:00 instead of the current time
>
> Ok, what i haven't understand is how can i do that:
>
> - should i extend the class DB_DataObject_FormBuilder and then
> ovverride the method that manages the date ?

Yes, you can.

Or you can set variables of a formbuilder istance:

$formBuilder->dateFromDatabaseCallback = 'myFunction';
$formBuilder->dateToDatabaseCallback = 'myFunction2';
$formBuilder->dateOptionsCallback = 'myTextDateOptions';

Maybe if I'll have more time I will be more helful.

Luca

>
> - should i create a new date type ? how can i then set up a method to
> manage my new date type?
>
> - something else ?
>
>
> On 9/18/07, Luca Giandoso <luca.giandoso@gmail.com> wrote:
>
>
> --
> /*************/
> nik600
> https://sourceforge.net/projects/ccmanager
> https://sourceforge.net/projects/nikstresser
>
> --
> PEAR General Mailing List (http://pear.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com