Skip to content
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

Deprecate QueryBuilder APIs exposing its internal state #5551

Merged
merged 1 commit into from Jul 30, 2022

Conversation

morozov
Copy link
Member

@morozov morozov commented Jul 30, 2022

Q A
Type improvement
  1. QueryBuilder::getState() and the corresponding constants are absolutely irrelevant. They are used by the builder internally for tracking whether the previously generated SQL needs to be rebuilt. The state expressed as separate enum-like property is redundant since the $sql property of the builder is nullable. Instead of marking the state as dirty, the builder can just set the value of $sql to NULL.
  2. The type of query being built is used by the builder internally in order to decide which SQL needs to be generated before executing it. The consumer of the QueryBuilder API is aware of the type of the query being built since it's the one who calls the select(), insert(), and the other methods defining the query type.

@morozov morozov marked this pull request as ready for review July 30, 2022 17:50
@morozov morozov merged commit e80b11c into doctrine:3.4.x Jul 30, 2022
@morozov morozov deleted the deprecate-query-builder-internals branch July 30, 2022 18:30
@morozov morozov added this to the 3.4.0 milestone Aug 2, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants