On my version - symfony 3.4 and "sonata-project/doctrine-orm-admin-bundle": "^3.0"
worked this way:
->add('preferredLanguage', 'doctrine_orm_choice', [
'global_search' => true,
'field_type' => ChoiceType::class,
'field_options' => [
'choices' => [
'English' => PotentialCustomerInterface::PREFERRED_LANGUAGE_ENGLISH,
'Spanish' => PotentialCustomerInterface::PREFERRED_LANGUAGE_SPANISH
]
]
]
)
The choices are string values in database.
If you want choices from database filtered by some logic:
->add('csr', 'doctrine_orm_choice', [
'field_type' => EntityType::class,
'field_options' => [
'class' => User::class,
'query_builder' => function (UserRepository $userRepository) {
return $userRepository->qbFindAdmins();
},
]
]
)
In UserRepository just create method which returns query builder.