-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Description
Describe the bug
\EasyCorp\Bundle\EasyAdminBundle\Field\AssociationField::setQueryBuilder()
does not behave as documented docs.
Firstly the contract only accepts Closures now.
Secondly, despite what is documented, the Closure is expected to configure the implicitly passed query builder (infered from here)
So it seems that we have two options:
- Configure the QueryBuilder that is implictly passed to the closure provided to setQueryBuilder()
- Configure the query builder like this
$someAssociationField->setFormTypeOption('query_builder', $someQueryBuilder);
To Reproduce
- Easy Admin Bundle 4.0.6
- Create an Entity, a Crud Controller and a form with an association field.
- Try to use AssociationField::setQueryBuilder() as documented
(OPTIONAL) Additional context
I can create a PR to update the docs if you want me too, I just need to know which of the options is the desired public contract.
Cheers
Ang3, talpaworld, bzhazreal, crazymad, mariogalan and 19 moreM0ude
Metadata
Metadata
Assignees
Labels
No labels