I create a form and add EntityType field:
->add('name', EntityType::class, [
'class' => MyTest::class,
'choice_label' => function($name){
return $name->getName();
},
'mapped' => false
])
I want show the Name that Category is car.
My database table is:
id | name | category