diff --git a/src/Colibri/Core/Hydrator/AbstractHydratorEntity.php b/src/Colibri/Core/Hydrator/AbstractHydratorEntity.php index 770f0e5..5652005 100644 --- a/src/Colibri/Core/Hydrator/AbstractHydratorEntity.php +++ b/src/Colibri/Core/Hydrator/AbstractHydratorEntity.php @@ -63,7 +63,7 @@ protected function hydrateEntityProperties(EntityInterface $entity, array $injec foreach ($injectData as $sqlName => $propertyValue) { $propertyName = $metadata->getName($sqlName, Metadata::CAMILIZED); $propertyValue = $propertyValue !== null - ? $metadata->toPhp($sqlName, $propertyValue) : null; + ? $metadata->toPhp($metadata->getName($sqlName), $propertyValue) : null; $this->setProperty($entity, $propertyName, $propertyValue); } @@ -96,12 +96,12 @@ public function extract($entity) { $metadata = $this->getMetadata(); $collection = []; - - foreach ($metadata->getNames() as $sqlName) { + + foreach ($metadata->getSQLNames() as $sqlName) { $propertyName = $metadata->getName($sqlName, Metadata::CAMILIZED); $propertyValue = $this->getReflection()->getProperty($propertyName)->getValue($entity); $propertyValue = $propertyValue !== null - ? $metadata->toPlatform($sqlName, $propertyValue) : null; + ? $metadata->toPlatform($metadata->getName($sqlName), $propertyValue) : null; $collection[$sqlName] = $propertyValue; }