-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Review the documentation regarding entity inheritance #10429
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mpdude
commented
Jan 19, 2023
mpdude
changed the title
Review the documentation on inheritance
Review the documentation regarding entity inheritance
Jan 19, 2023
greg0ire
reviewed
Jan 19, 2023
mpdude
added a commit
to mpdude/doctrine2
that referenced
this pull request
Jan 19, 2023
When my understanding is correct, inheritance has to be declared as soon as one entity class extends (directly or through middle classes) another one. Catching missing inheritance declarations early on is important to avoid weird errors further down the road, giving users a clear indication of the root cause. The documentation is updated accordingly at doctrine#10429.
Co-authored-by: Grégoire Paris <postmaster@greg0ire.fr>
Co-authored-by: Grégoire Paris <postmaster@greg0ire.fr>
Co-authored-by: Grégoire Paris <postmaster@greg0ire.fr>
Co-authored-by: Grégoire Paris <postmaster@greg0ire.fr>
mpdude
added a commit
to mpdude/doctrine2
that referenced
this pull request
Jan 19, 2023
When my understanding is correct, inheritance has to be declared as soon as one entity class extends (directly or through middle classes) another one. Catching missing inheritance declarations early on is important to avoid weird errors further down the road, giving users a clear indication of the root cause. The documentation is updated accordingly at doctrine#10429.
All feedback addressed |
greg0ire
approved these changes
Jan 19, 2023
Thanks @mpdude ! |
mpdude
added a commit
to mpdude/doctrine2
that referenced
this pull request
Jan 20, 2023
Inheritance has to be declared as soon as one entity class extends (directly or through middle classes) another one. This is also pointed out in the opening comment for doctrine#8348: > Entities are not allowed to extend from entities without an inheritence mapping relationship (Single Table or Joined Table inheritance). [...] While Doctrine so far allowed these things, they are fragile and will break on certain scenarios. Throwing an exception in case of this misconfiguration is nothing we should do light-heartedly, given that it may surprise users in a bugfix or feature release. So, we should start with a deprecation notice and make this an exception in 3.0. The documentation is updated accordingly at doctrine#10429. Catching missing inheritance declarations early on is important to avoid weird errors further down the road, giving users a clear indication of the root cause. In case you are affected by this, please understand that although things "previously worked" for you, you have been using the ORM outside of what it was designed to do. That may have worked in simple cases, but may also have caused invalid results (wrong or missing data after hydration?) that possibly went unnoticed in subtle cases.
mpdude
added a commit
to mpdude/doctrine2
that referenced
this pull request
Jan 23, 2023
Inheritance has to be declared as soon as one entity class extends (directly or through middle classes) another one. This is also pointed out in the opening comment for doctrine#8348: > Entities are not allowed to extend from entities without an inheritence mapping relationship (Single Table or Joined Table inheritance). [...] While Doctrine so far allowed these things, they are fragile and will break on certain scenarios. Throwing an exception in case of this misconfiguration is nothing we should do light-heartedly, given that it may surprise users in a bugfix or feature release. So, we should start with a deprecation notice and make this an exception in 3.0. The documentation is updated accordingly at doctrine#10429. Catching missing inheritance declarations early on is important to avoid weird errors further down the road, giving users a clear indication of the root cause. In case you are affected by this, please understand that although things "previously worked" for you, you have been using the ORM outside of what it was designed to do. That may have worked in simple cases, but may also have caused invalid results (wrong or missing data after hydration?) that possibly went unnoticed in subtle cases.
mpdude
added a commit
to mpdude/doctrine2
that referenced
this pull request
Jan 23, 2023
Inheritance has to be declared as soon as one entity class extends (directly or through middle classes) another one. This is also pointed out in the opening comment for doctrine#8348: > Entities are not allowed to extend from entities without an inheritence mapping relationship (Single Table or Joined Table inheritance). [...] While Doctrine so far allowed these things, they are fragile and will break on certain scenarios. Throwing an exception in case of this misconfiguration is nothing we should do light-heartedly, given that it may surprise users in a bugfix or feature release. So, we should start with a deprecation notice and make this an exception in 3.0. The documentation is updated accordingly at doctrine#10429. Catching missing inheritance declarations early on is important to avoid weird errors further down the road, giving users a clear indication of the root cause. In case you are affected by this, please understand that although things "previously worked" for you, you have been using the ORM outside of what it was designed to do. That may have worked in simple cases, but may also have caused invalid results (wrong or missing data after hydration?) that possibly went unnoticed in subtle cases.
mpdude
added a commit
to mpdude/doctrine2
that referenced
this pull request
Jan 24, 2023
Inheritance has to be declared as soon as one entity class extends (directly or through middle classes) another one. This is also pointed out in the opening comment for doctrine#8348: > Entities are not allowed to extend from entities without an inheritence mapping relationship (Single Table or Joined Table inheritance). [...] While Doctrine so far allowed these things, they are fragile and will break on certain scenarios. Throwing an exception in case of this misconfiguration is nothing we should do light-heartedly, given that it may surprise users in a bugfix or feature release. So, we should start with a deprecation notice and make this an exception in 3.0. The documentation is updated accordingly at doctrine#10429. Catching missing inheritance declarations early on is important to avoid weird errors further down the road, giving users a clear indication of the root cause. In case you are affected by this, please understand that although things "previously worked" for you, you have been using the ORM outside of what it was designed to do. That may have worked in simple cases, but may also have caused invalid results (wrong or missing data after hydration?) that possibly went unnoticed in subtle cases.
derrabus
pushed a commit
that referenced
this pull request
Jan 24, 2023
Inheritance has to be declared as soon as one entity class extends (directly or through middle classes) another one. This is also pointed out in the opening comment for #8348: > Entities are not allowed to extend from entities without an inheritence mapping relationship (Single Table or Joined Table inheritance). [...] While Doctrine so far allowed these things, they are fragile and will break on certain scenarios. Throwing an exception in case of this misconfiguration is nothing we should do light-heartedly, given that it may surprise users in a bugfix or feature release. So, we should start with a deprecation notice and make this an exception in 3.0. The documentation is updated accordingly at #10429. Catching missing inheritance declarations early on is important to avoid weird errors further down the road, giving users a clear indication of the root cause. In case you are affected by this, please understand that although things "previously worked" for you, you have been using the ORM outside of what it was designed to do. That may have worked in simple cases, but may also have caused invalid results (wrong or missing data after hydration?) that possibly went unnoticed in subtle cases.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR gives the documentation chapter on inheritance a brush-up.
Add new typos