Hi friends,

I have generated backend by symfony.
Suppose i have a table in schema.yml
  listing:
    id:
    type: char
    name:

Then i have generated Model, Sql and Backend by symfony.
Now the problem is: If, in the database "listing.type"  have null
value and i open a listing by symfony backend to Edit.

We did not done any changes and save this listing. Then all columns
that have null values replaced by blank values for this listing.


On Jul 24, 6:11 pm, John Kary <[email protected]> wrote:
> Firstly, I'd recommend reading about the difference between a NULL
> value and a blank string 
> value:http://www.databasedev.co.uk/null_values_defined.html
>
> A NULL is a truly unknown value. Like if you loaded fixtures and did
> not define some fields in the fixture, the records would import with
> NULL values in those columns you did not define.
>
> But if presented with a form that has a field for a value, and you do
> not enter a value, you were given a chance to complete that field, and
> so it IS known.
>
> The solution would be to remove the field you want to keep as NULL
> from your form's configure() method:
>
> class UserForm extends BaseUserForm
> {
>     public function configure()
>     {
>         unset($this['middle_initial']);
>     }
>
> }
>
> On Jul 24, 3:50 am, brajesh <[email protected]> wrote:
>
> > Hi Friends,
>
> > The backend displlays the NULL values stored in db as blank textboxes.
> > When no values are entered in the backend tool, it is stored as a
> > blank value in the database rather than a NULL value. How can I set it
> > as a NULL value?
>
> > Please help...
>
> > Thanks
> > Brajesh

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.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

Reply via email to