Skip to content

Commit 1329296

Browse files
committed
Reword text
1 parent 39a4349 commit 1329296

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

docs/en/reference/limitations-and-known-issues.rst

+6-7
Original file line numberDiff line numberDiff line change
@@ -136,18 +136,17 @@ ORM:
136136
Using Traits in Entity Classes
137137
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
138138

139-
There is no real "official" statement whether or to which extent traits
140-
are supported in entity or mapped superclasses.
139+
The use of traits in entity or mapped superclasses, at least when they
140+
include mapping configuration or mapped fields, is currently not
141+
endorsed by the Doctrine project. The reasons for this are as follows.
141142

142143
Traits were added in PHP 5.4 more than 10 years ago, but at the same time
143144
more than two years after the initial Doctrine 2 release and the time where
144145
core components were designed.
145146

146147
In fact, this documentation mentions traits only in the context of
147-
:doc:`overriding field association mappings in subclasses <tutorials/override-field-association-mappings-in-subclasses>`. Also, the
148-
tests in the ORM codebase (as of writing) cover traits only in two (!) places,
149-
namely the aforementioned override and in an edge-case for a tool that will be
150-
removed in Doctrine 3.0.
148+
:doc:`overriding field association mappings in subclasses <tutorials/override-field-association-mappings-in-subclasses>`. Coverage
149+
of traits in test cases is practically nonexistent.
151150

152151
Thus, you should at least be aware that when using traits in your entity and
153152
mapped superclasses, you will be in uncharted terrain.
@@ -168,7 +167,7 @@ have produced, this is probably fine.
168167

169168
However, to mention known limitations, it is currently not possible to use "class" level
170169
`annotations <https://github.com/doctrine/orm/pull/1517>` or `attributes <https://github.com/doctrine/orm/issues/8868>` on traits, and attempts to improve parser support
171-
for traits as `here <https://github.com/doctrine/annotations/pull/102>` or `there <https://github.com/doctrine/annotations/pull/63>` have been abandoned.
170+
for traits as `here <https://github.com/doctrine/annotations/pull/102>` or `there <https://github.com/doctrine/annotations/pull/63>` have been abandoned due to complexity.
172171

173172
XML mapping configuration probably needs to completely re-configure or otherwise
174173
copy-and-paste configuration for fields used from traits.

0 commit comments

Comments
 (0)