Example:
I have 3 Entities with the following properties:
User
name
Certification
name
UserCertification
User
Certification
I have the following in my UserCertificationCrudController:
public function configureFields(string $pageName): iterable
{
return [
AssociationField::new('user')
->autocomplete(),
AssociationField::new('memberCertification')
->autocomplete(),
'lastRenewed',
'expiration',
];
}
See the following screenshot when creating a new UserCertification
:
The autocomplete value is a reference to the respective Entity ID. How would we replace User#
with the name property on the user?
Things I have already tried with no success:
ChoiceField->setFormTypeOptions()
method, as well as the result of UserRepository->FindAll()
to the ChoiceField->setChoices()
methodAssociationField->setFormTypeOptions()
methodDo you try to mmake the __toString()
method of the entity ?