@@ -31,7 +31,16 @@ class AttributeDriver extends CompatibilityAnnotationDriver
31
31
{
32
32
use ColocatedMappingDriver;
33
33
34
- /** @var array<class-string<MappingAttribute>, int> */
34
+ private const ENTITY_ATTRIBUTE_CLASSES = [
35
+ Mapping \Entity::class => 1 ,
36
+ Mapping \MappedSuperclass::class => 2 ,
37
+ ];
38
+
39
+ /**
40
+ * @deprecated override isTransient() instead of overriding it
41
+ *
42
+ * @var array<class-string<MappingAttribute>, int>
43
+ */
35
44
protected $ entityAnnotationClasses = [
36
45
Mapping \Entity::class => 1 ,
37
46
Mapping \MappedSuperclass::class => 2 ,
@@ -58,6 +67,15 @@ public function __construct(array $paths)
58
67
59
68
$ this ->reader = new AttributeReader ();
60
69
$ this ->addPaths ($ paths );
70
+
71
+ if ($ this ->entityAnnotationClasses !== self ::ENTITY_ATTRIBUTE_CLASSES ) {
72
+ Deprecation::trigger (
73
+ 'doctrine/orm ' ,
74
+ 'https://github.com/doctrine/orm/pull/10204 ' ,
75
+ 'Changing the value of %s::$entityAnnotationClasses is deprecated and will have no effect in Doctrine ORM 3.0. ' ,
76
+ self ::class
77
+ );
78
+ }
61
79
}
62
80
63
81
/**
@@ -88,7 +106,7 @@ public function isTransient($className)
88
106
89
107
foreach ($ classAttributes as $ a ) {
90
108
$ attr = $ a instanceof RepeatableAttributeCollection ? $ a [0 ] : $ a ;
91
- if (isset ($ this ->entityAnnotationClasses [get_class ($ attr )])) {
109
+ if (isset ($ this ->entityAttributeClasses [get_class ($ attr )])) {
92
110
return false ;
93
111
}
94
112
}
0 commit comments