According to the doc,The
boolean
type is a specializedChoiceType
, where the list of choices is locked to yes and no.Note that for backward compatibility reasons, it will set your value to 1 for yes and to 2 for no. If you want to map to a boolean value, just set the option
transform
to true. For instance, you need to do so when mapping to a doctrine boolean.