Skip to content

Commit

Permalink
Update AbstractHydratorEntity.php
Browse files Browse the repository at this point in the history
  • Loading branch information
dezbyte authored Sep 25, 2017
1 parent 4a93a57 commit f30059e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Colibri/Core/Hydrator/AbstractHydratorEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit f30059e

Please sign in to comment.