Skip to content

Commit a2494a2

Browse files
committed
Revert "fix: handle DocumentNotFound for nullable ElasticEntity properties"
This reverts commit f55340b.
1 parent f55340b commit a2494a2

1 file changed

Lines changed: 4 additions & 13 deletions

File tree

src/Factory/EntityFactory.php

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -243,19 +243,10 @@ class: $value[\Spameri\Elastic\Model\Insert\PrepareEntityArray::ENTITY_CLASS],
243243
$this->identityMap->uninitializedEntityList[$propertyTypeName][$value][$property->getName()][$hit->id()] = $class;
244244

245245
} else {
246-
try {
247-
$propertyValue = $entityManager->find(
248-
id: $value,
249-
class: $propertyTypeName,
250-
);
251-
} catch (\Spameri\Elastic\Exception\DocumentNotFound $e) {
252-
if ($reflectionPropertyType->allowsNull()) {
253-
$propertyValue = null;
254-
$setNull = true;
255-
} else {
256-
throw $e;
257-
}
258-
}
246+
$propertyValue = $entityManager->find(
247+
id: $value,
248+
class: $propertyTypeName,
249+
);
259250
}
260251

261252
} elseif ($this->container->getByType($propertyTypeName, false) !== null) {

0 commit comments

Comments
 (0)