I have the following code:
$builder->add('category', 'entity', [
'required' => false,
'class' => 'Ras\Bundle\DomainBundle\Entity\Category',
'choice_value' => 'name',
'choice_label' => 'label'
]);
When I select a category it does not give me the selected category entity, but when I changed choice_value to be id it worked fine. There seem to be an issue when the choice_value is a string attribute
NOTE:
Ras\Bundle\DomainBundle\Entity\Category entity has following attributes: id, name, label