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

Put up a warning sign that mapping may not be inherited from transient classes #10392

Merged
merged 2 commits into from
Feb 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions docs/en/reference/inheritance-mapping.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,19 @@ need not have an ``#[Id]`` property.
For further support of inheritance, the single or
joined table inheritance features have to be used.

.. warning::

At least when using attributes or annotations to specify your mapping,
it _seems_ as if you could inherit from a base class that is neither
an entity nor a mapped superclass, but has properties with mapping configuration
on them that would also be used in the inheriting class.

This, however, is due to how the corresponding mapping
drivers work and what the PHP reflection API reports for inherited fields.

Such a configuration is explicitly not supported. To give just one example,
it will break for ``private`` properties.

.. note::

You may be tempted to use traits to mix mapped fields or relationships
Expand Down