diff --git a/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php b/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php index 4c269a7e634..9b9450ead11 100644 --- a/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php +++ b/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php @@ -840,7 +840,11 @@ public function loadOneToOneEntity(array $assoc, $sourceEntity, array $identifie // this case we directly reference the column-keyed data used // to initialize the source entity before throwing an exception. $resolvedSourceData = false; - if (isset(($sourceEntityData ??= $this->em->getUnitOfWork()->getOriginalEntityData($sourceEntity))[$sourceKeyColumn])) { + if (! isset($sourceEntityData)) { + $sourceEntityData = $this->em->getUnitOfWork()->getOriginalEntityData($sourceEntity); + } + + if (isset($sourceEntityData[$sourceKeyColumn])) { $dataValue = $sourceEntityData[$sourceKeyColumn]; if ($dataValue !== null) { $resolvedSourceData = true;