Form: Avoid setting null to non submitted field
问题 I've got a simple model (simplified of source): class Collection { public $page; public $limit; } And a form type: class CollectionType extends AbstractType { public function buildForm(FormBuilderInterface $builder, array $options) { $builder->add('page', 'integer'); $builder->add('limit', 'integer'); } public function setDefaultOptions(OptionsResolverInterface $resolver) { $resolver->setDefaults(array( 'data_class' => 'FSC\Common\Rest\Form\Model\Collection', )); } } My controller: public