Skip to content

Commit b8a071e

Browse files
authored
Update DoctrineEntityHydrationExtension.php
1 parent 251d673 commit b8a071e

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/LiveComponent/src/Hydration/DoctrineEntityHydrationExtension.php

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -102,18 +102,13 @@ private function objectManagerFor(string $class): ?ObjectManager
102102

103103
foreach ($this->managerRegistries as $registry) {
104104
foreach ($registry->getManagers() as $om) {
105-
// the getClassMetaData can indeed throw an exception
106-
// so, we
105+
107106
try {
108107
if (null !== $om->getClassMetadata($class)) {
109108
return self::ensureManagedObject($om, $class);
110109
}
111110
} catch (MappingException $e) {
112-
// I did not find a nice way to check if it is because the class is really unknown
113-
// It is good to check for a specific exception ?
114-
// eg: \Doctrine\Persistence\Mapping\MappingException
115-
// @see \Doctrine\Persistence\Mapping\AbstractClassMetadataFactory::getMetadataFor
116-
// throw $e;
111+
// Catching Excpetion in case of the $class does not match a valid classname or a valid interface name
117112
}
118113
}
119114
}

0 commit comments

Comments
 (0)