I have an entity User and an entity Address which are in OneToOne relationship. I would like to display the address type in the User Crud in EasyAdmin, and I don't find a way to do just like Symfony ->add('address', AddressType::class).
I tried the following options:
CollectionField::new('address')
->setEntryIsComplex(true)
->setEntryType(AddressType::class)
->setFormTypeOptions([
'by_reference' => false,
'required' => true
]),
But this makes the user able to add as many as addresses he wants, although I just want one.
AssociationField::new('address')->hideOnIndex()
This one makes the user choose an existing address in a list. That's not an embed of a form type.
Does anyone have an idea?
->setEntryType(AddressType::class)?setEntryType()doesn't exist for AssociationField->setFormType()here