Skip to content

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

Merged
merged 1 commit into from
Dec 14, 2016
Merged

Update 'query_builder' option #7220

merged 1 commit into from
Dec 14, 2016

Conversation

jokaio
Copy link

@jokaio jokaio commented Dec 3, 2016

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

@HeahDude
Copy link
Contributor

HeahDude commented Dec 3, 2016

Looks good, thanks @phrix32!

👍

Status: Reviewed

@jokaio jokaio changed the base branch from master to 2.7 December 3, 2016 14:53
@xabbuh
Copy link
Member

xabbuh commented Dec 8, 2016

@phrix32 When changing the base branch, you have to rebase your changes. Are you able to do that? Can we help you with it?

@jokaio
Copy link
Author

jokaio commented Dec 8, 2016

Oh sorry, I forgot that. I'm not sure if I rebased correctly now. Can you please check @xabbuh?

Copy link
Member

@xabbuh xabbuh left a 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
Copy link
Member

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`_.
Copy link
Member

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.
Copy link
Member

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.
@jokaio
Copy link
Author

jokaio commented Dec 9, 2016

Hey @xabbuh I adapted the documentation like you suggested.

@xabbuh
Copy link
Member

xabbuh commented Dec 14, 2016

Thank you @phrix32.

@xabbuh xabbuh merged commit bab634b into symfony:2.7 Dec 14, 2016
xabbuh added a commit that referenced this pull request Dec 14, 2016
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
xabbuh added a commit that referenced this pull request Dec 14, 2016
xabbuh added a commit that referenced this pull request Dec 14, 2016
* 2.7:
  [#7220] some minor tweaks
  Update 'query_builder' option
xabbuh added a commit that referenced this pull request Dec 14, 2016
* 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
xabbuh added a commit that referenced this pull request Dec 14, 2016
* 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
xabbuh added a commit that referenced this pull request Dec 14, 2016
* 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
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants