From 25cdb15907e9f628ca0613d1a604f1fecbeceda5 Mon Sep 17 00:00:00 2001 From: Henning Date: Thu, 26 Aug 2021 17:15:13 +0200 Subject: [PATCH] fix for closures --- .../CodeGenerator/Visitor/AbstractHydratorMethodsVisitor.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Mordilion/GeneratedAbstractHydrator/CodeGenerator/Visitor/AbstractHydratorMethodsVisitor.php b/src/Mordilion/GeneratedAbstractHydrator/CodeGenerator/Visitor/AbstractHydratorMethodsVisitor.php index 4b09086..4bd5264 100644 --- a/src/Mordilion/GeneratedAbstractHydrator/CodeGenerator/Visitor/AbstractHydratorMethodsVisitor.php +++ b/src/Mordilion/GeneratedAbstractHydrator/CodeGenerator/Visitor/AbstractHydratorMethodsVisitor.php @@ -110,7 +110,7 @@ private function appendHydrateClosureParts(array &$parts, array $properties): vo foreach ($properties as $property) { $propertyName = $property->name; - $parts[] = " \$name = \$this->extractName('" . $propertyName . "', \$object);"; + $parts[] = " \$name = \$that->extractName('" . $propertyName . "', \$object);"; $parts[] = " if (isset(\$data[\$name]) || " . '$object->' . $propertyName . " !== null && \\array_key_exists(\$name, \$data)) {"; $parts[] = $this->getPropertyHydrateString($propertyName, 2, true); @@ -127,7 +127,7 @@ private function appendExtractClosureParts(array &$parts, array $properties): vo foreach ($properties as $property) { $propertyName = $property->name; - $parts[] = " \$name = \$this->hydrateName('" . $propertyName . "', \$data);"; + $parts[] = " \$name = \$that->hydrateName('" . $propertyName . "', \$data);"; $parts[] = $this->getPropertyExtractString($propertyName, 1, true); } }