-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Update 'query_builder' option #7220
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
Conversation
Looks good, thanks @phrix32! 👍 Status: Reviewed |
@phrix32 When changing the base branch, you have to rebase your changes. Are you able to do that? Can we help you with it? |
Oh sorry, I forgot that. I'm not sure if I rebased correctly now. Can you please check @xabbuh? |
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.
@phrix32 The renew looks good. I also like the change in general and left just some minor comments.
@@ -191,6 +191,13 @@ The value of this option can either be a ``QueryBuilder`` object, a Closure or | |||
passed the ``EntityRepository`` of the entity as the only argument and should | |||
return a ``QueryBuilder``. | |||
|
|||
.. caution:: | |||
|
|||
The entity used in ``FROM`` clause of `query_builder`_ option |
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.
[...] used in the FROM
[...]
.. caution:: | ||
|
||
The entity used in ``FROM`` clause of `query_builder`_ option | ||
will always be validated against the class which you have specified in form field option `class`_. |
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.
[...] which you have specified with the form's class
option.
The entity used in ``FROM`` clause of `query_builder`_ option | ||
will always be validated against the class which you have specified in form field option `class`_. | ||
If you return another entity instead of the one used in your ``FROM`` clause, | ||
for instance ``SELECT`` an entity from a joined table, it will break validation. |
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.
(for instance if you return an entity from a joined table)
The entity used in 'FROM' clause of 'query_builder' option will always be validated against the class which you have specified in form field option 'class'. If you return another entity instead of the one used in your FROM clause, for instance SELECT an entity from a joined table, it will break validation.
Hey @xabbuh I adapted the documentation like you suggested. |
Thank you @phrix32. |
This PR was merged into the 2.7 branch. Discussion ---------- Update 'query_builder' option The entity used in 'FROM' clause of 'query_builder' option will always be validated against the class which you have specified in form field option 'class'. If you return another entity instead of the one used in your FROM clause, for instance SELECT an entity from a joined table, it will break validation. Closes #4331 Commits ------- bab634b Update 'query_builder' option
* 2.7: [#7220] some minor tweaks Update 'query_builder' option
* 2.8: [#7220] some minor tweaks Use PHP 5.5's ::class notation [#7243] minor tweak Deletes duplicate "Deprecated" and adds a more explicit example. Accepted Suggestions Update 'query_builder' option Accepted suggestions in the guard documentation Accepted suggestions in the guard documentation Accepted suggestions in the guard documentation Update guard_authentication.rst Use PHP 5.5's ::class notation
* 3.1: [#7220] some minor tweaks Added "How to Use a Custom Version Strategy for Assets" Use PHP 5.5's ::class notation [#7243] minor tweak Deletes duplicate "Deprecated" and adds a more explicit example. Accepted Suggestions Update 'query_builder' option Accepted suggestions in the guard documentation Accepted suggestions in the guard documentation Accepted suggestions in the guard documentation Update guard_authentication.rst Use PHP 5.5's ::class notation
* 3.2: (22 commits) add missing config formats [#7224] fix indentation [#7220] some minor tweaks [#7196] add versionadded directive Explained how to improve the readability of long numeric literals Fix typo in workflow usage code lock Added "How to Use a Custom Version Strategy for Assets" Use PHP 5.5's ::class notation Update state-machines.rst [PHPUnitBridge] Fix copy/paste error [PHPUnitBridge] Fix copy/paste error [#7243] minor tweak Deletes duplicate "Deprecated" and adds a more explicit example. Accepted Suggestions Update 'query_builder' option Mentioned %env(...)% variables in Best Practices book Accepted suggestions in the guard documentation Accepted suggestions in the guard documentation Accepted suggestions in the guard documentation Update guard_authentication.rst ...
The entity used in 'FROM' clause of 'query_builder' option will always be validated against the class which you have specified in form field option 'class'. If you return another entity instead of the one used in your FROM clause, for instance SELECT an entity from a joined table, it will break validation.
Closes #4331