@@ -609,15 +609,6 @@ final class ClassMetadata implements BaseClassMetadata
609609 */
610610 public private(set) array $ subClasses = [];
611611
612- /**
613- * The ReflectionProperty instances of the mapped class.
614- *
615- * @deprecated Since 2.13, use $propertyAccessors instead.
616- *
617- * @var LegacyReflectionFields|array<ReflectionProperty>
618- */
619- public private(set) LegacyReflectionFields |array $ reflFields = [];
620-
621612 /** @var array<string, PropertyAccessors\PropertyAccessor> */
622613 public private(set) array $ propertyAccessors = [];
623614
@@ -819,7 +810,6 @@ public function __construct(string $documentName)
819810 $ this ->rootDocumentName = $ documentName ;
820811 $ this ->reflectionService = new RuntimeReflectionService ();
821812 $ this ->reflClass = new ReflectionClass ($ documentName );
822- $ this ->reflFields = new LegacyReflectionFields ($ this , $ this ->reflectionService );
823813 $ this ->setCollection ($ this ->reflClass ->getShortName ());
824814 $ this ->instantiator = new Instantiator ();
825815 }
@@ -1424,29 +1414,6 @@ public function isChangeTrackingDeferredImplicit(): bool
14241414 return $ this ->changeTrackingPolicy === self ::CHANGETRACKING_DEFERRED_IMPLICIT ;
14251415 }
14261416
1427- /**
1428- * Whether the change tracking policy of this class is "notify".
1429- *
1430- * @deprecated This method was deprecated in doctrine/mongodb-odm 2.4. Please use DEFERRED_EXPLICIT tracking
1431- * policy and isChangeTrackingDeferredImplicit method to detect it.
1432- */
1433- public function isChangeTrackingNotify (): bool
1434- {
1435- return $ this ->changeTrackingPolicy === self ::CHANGETRACKING_NOTIFY ;
1436- }
1437-
1438- /**
1439- * Gets the ReflectionProperties of the mapped class.
1440- *
1441- * @deprecated Since 2.13, use getPropertyAccessors() instead.
1442- *
1443- * @return array<ReflectionProperty>|LegacyReflectionFields
1444- */
1445- public function getReflectionProperties (): array |LegacyReflectionFields
1446- {
1447- return $ this ->reflFields ;
1448- }
1449-
14501417 /**
14511418 * Gets the ReflectionProperties of the mapped class.
14521419 *
@@ -1457,16 +1424,6 @@ public function getPropertyAccessors(): array
14571424 return $ this ->propertyAccessors ;
14581425 }
14591426
1460- /**
1461- * Gets a ReflectionProperty for a specific field of the mapped class.
1462- *
1463- * @deprecated Since 2.13, use getPropertyAccessor() instead.
1464- */
1465- public function getReflectionProperty (string $ name ): ReflectionProperty
1466- {
1467- return $ this ->reflFields [$ name ];
1468- }
1469-
14701427 public function getPropertyAccessor (string $ name ): PropertyAccessor |null
14711428 {
14721429 return $ this ->propertyAccessors [$ name ] ?? null ;
@@ -2407,13 +2364,7 @@ public function mapField(array $mapping): array
24072364 }
24082365
24092366 if (isset ($ mapping ['targetDocument ' ]) && isset ($ mapping ['discriminatorMap ' ])) {
2410- trigger_deprecation (
2411- 'doctrine/mongodb-odm ' ,
2412- '2.2 ' ,
2413- 'Mapping both "targetDocument" and "discriminatorMap" on field "%s" in class "%s" is deprecated. Only one of them can be used at a time ' ,
2414- $ mapping ['fieldName ' ],
2415- $ this ->name ,
2416- );
2367+ throw MappingException::targetDocumentCanNotBeCombinedWithDiscriminatorMap ($ this ->name , $ mapping ['fieldName ' ]);
24172368 }
24182369
24192370 if (isset ($ mapping ['reference ' ]) && $ mapping ['type ' ] === self ::ONE ) {
@@ -2535,7 +2486,6 @@ public function mapField(array $mapping): array
25352486 *
25362487 * Parts that are also NOT serialized because they cannot be properly unserialized:
25372488 * - reflClass (ReflectionClass)
2538- * - reflFields (ReflectionProperty array)
25392489 * - propertyAccessors (ReflectionProperty array)
25402490 *
25412491 * @return array The names of all the fields that should be serialized.
@@ -2646,7 +2596,6 @@ public function __wakeup(): void
26462596 $ this ->reflClass = new ReflectionClass ($ this ->name );
26472597 $ this ->instantiator = new Instantiator ();
26482598 $ this ->reflectionService = new RuntimeReflectionService ();
2649- $ this ->reflFields = new LegacyReflectionFields ($ this , $ this ->reflectionService );
26502599
26512600 foreach ($ this ->fieldMappings as $ field => $ mapping ) {
26522601 $ accessor = PropertyAccessorFactory::createPropertyAccessor ($ mapping ['declared ' ] ?? $ this ->name , $ field );
0 commit comments