2

i try to create an entity with fosrestBundle, symfony and doctrine

If i give all the datas in my json, it works

I have one field 'test' that cannot be null and it has the defeault value "0"

in my entity, i have :

/**
 * @var smallint
 */
private $test= '0';

in my orm.yml file :

test:
        type: smallint
        nullable: false
        options:
            default: '0'
        column: ind_archive

And when i call my WS without : SQLSTATE[23000]: Integrity constraint violation: 1048 field 'test' cannot be null

What am i doing wrong ?

pop_up
  • 1,451
  • 2
  • 18
  • 35

0 Answers0