Another way is to add a updateXXXColumn to the form:
public function updateXXXXColumn($value)
{
if(empty($value)) return false;
return $value;
}
replace XXX with your column-name. In case the value is empty the
parameter is removed from the response and null schould be used.
greets
Sven
Adrien Mogenet schrieb:
> Yes I do :-)
>
> I'm going to check this now.
>
> I temporary overrode the setLogin() method which sets NULL if empty
> string.
>
> Thanks,
>
> Adrien
>
> On 7 mai, 10:40, cokker <[email protected]> wrote:
>> Do you use Sf1.2 with sfForm?
>>
>> If so have a look at the stringValidator if uses as empty value a string
>> ('') not null
>>
>> greets
>> Sven
>>
>> Adrien Mogenet schrieb:
>>
>>> Hi all,
>>> I get a very stupid question... and I'm really surprized to see that I
>>> can't find any solution thanks to Google !
>>> Simple Model :
>>> ----------------------
>>> user:
>>> id: ~
>>> login: {varchar, required: false}
>>> foobar: {varchar, required: true}
>>> And then, when I'm filling my form, if I fill only `foobar` and not
>>> `login`, an empty string is stored and not the NULL value.
>>> BUT, I want to store a NULL value... how can I do that ?
>>> PS: Don't think too much about my model it's just a simple example ;)
>>> --
>>> Adrien
>>> http://ze-technology.blogspot.com
> >
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"symfony users" 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/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---