-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add callback field #321
base: 1.13
Are you sure you want to change the base?
add callback field #321
Conversation
Florian-Merle
commented
Mar 22, 2024
•
edited
Loading
edited
228c8fe
to
6a1c438
Compare
By default it uses the name of the field, but you can specify the path | ||
alternatively. For example: | ||
|
||
<details open><summary>PHP</summary> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To match existing documentation, please add YAML example as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not include documentation for the YAML format because I believe it's impossible to define a callback field in this format.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feature is not complete then and cannot be merged until YAML support will be dropped.
Here is example on how callback can be implemented with non-php config format.
https://symfony.com/doc/current/reference/constraints/Callback.html#external-callbacks-and-closures
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can do it. The repository can be a callback in YAML.
app_book_by_english_authors:
driver:
name: doctrine/orm
options:
class: App\Entity\Book
repository:
method: [expr:service('app.english_books_query_builder'), create]
6a1c438
to
ed2cd03
Compare
ed2cd03
to
47d1dd0
Compare