From d623d219cf5aecd169c8d01d54d5b33e40d04f47 Mon Sep 17 00:00:00 2001 From: wiseguy1394 Date: Wed, 14 Aug 2024 16:01:31 +0200 Subject: [PATCH] Call convertToDatabaseValue --- src/Persisters/Entity/BasicEntityPersister.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Persisters/Entity/BasicEntityPersister.php b/src/Persisters/Entity/BasicEntityPersister.php index 377e03ce274..cd0d14984fa 100644 --- a/src/Persisters/Entity/BasicEntityPersister.php +++ b/src/Persisters/Entity/BasicEntityPersister.php @@ -1964,8 +1964,14 @@ private function getIndividualValue(mixed $value): array return $newValue; } + + $singleIdentifierValue = $this->em->getUnitOfWork()->getSingleIdentifierValue($value); + $identifier = $class->getIdentifier()[0]; - return [$this->em->getUnitOfWork()->getSingleIdentifierValue($value)]; + $singleIdentifierValue = Type::getType($class->fieldMappings[$identifier]->type) + ->convertToDatabaseValue($singleIdentifierValue,$this->platform); + + return [$singleIdentifierValue];; } public function exists(object $entity, Criteria|null $extraConditions = null): bool