We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
hydrateProperties
1 parent 5ea4554 commit 2aa4cb6Copy full SHA for 2aa4cb6
src/ArrayHydrator.php
@@ -4,6 +4,7 @@
4
use Doctrine\DBAL\Types\Type;
5
use Doctrine\ORM\EntityManagerInterface;
6
use Doctrine\ORM\Mapping\ClassMetadataInfo;
7
+use Doctrine\Persistence\Proxy;
8
use Exception;
9
10
class ArrayHydrator
@@ -106,7 +107,11 @@ public function setHydrateBy($hydrateBy)
106
107
*/
108
protected function hydrateProperties($entity, $data)
109
{
- $reflectionObject = new \ReflectionObject($entity);
110
+ if ($entity instanceof Proxy) {
111
+ $reflectionObject = (new \ReflectionObject($entity))->getParentClass();
112
+ } else {
113
+ $reflectionObject = new \ReflectionObject($entity);
114
+ }
115
116
$metaData = $this->entityManager->getClassMetadata(get_class($entity));
117
0 commit comments