When I create a new entity, I want a certain checkbox to be checked by default. As the documentation says I used the data attribute, but now when I edit the same entity the checkbox is checked wether the value is 0 or 1.
How can I make it so that when I do a new entity, the checkbox is checked. but when I uncheck it, store the entity, and edit it, it uses the stored value ?
$builder
->add(
'naamOrganisatie',
'text',
array(
'label' => 'Naam organisatie',
'required' => false)
)
->add('isOrganisatie', 'checkbox', array('required' => false, 'data' => true))
->add('naam', 'text', array('required' => false))
->add('voornaam', 'text', array('required' => false))
->add('vestigingsnummer');