Anonymous Anonymous - 2 months ago
127 0

How to set a default value with options={"default":0}

In this example we create a foo property/field with a default value of 0.

PHP

Doctrine entity set default value

/**
* @ORM\Column(name="foo", type="smallint", options={"default":0})
*/
private $foo