I have the following code, which I try to pre-select the 1st and 2nd option of the checkbox when rendered. However this doesn't work. Can anyone help me why?
$builder->add('preferredContactTypes', 'entity', array('class' => 'AppMainBundle:ContactType', 'property' => 'type', 'multiple' => true, 'expanded' => true, 'mapped' => false, 'data' => array(1,2)))