Skip to content

Commit 8be7c70

Browse files
committed
Add proxy class ignore
1 parent 2658661 commit 8be7c70

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/Subscribers/DoctrineEncryptSubscriber.php

+7
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use Doctrine\Common\EventSubscriber;
66
use Doctrine\Common\Proxy\Proxy;
7+
use Doctrine\Common\Util\ClassUtils;
78
use Doctrine\ORM\EntityManager;
89
use Doctrine\ORM\Event\LifecycleEventArgs;
910
use Doctrine\ORM\Event\PostFlushEventArgs;
@@ -259,6 +260,12 @@ public function processFields($entity, $isEncryptOperation = true)
259260
return null;
260261
}
261262

263+
$nonProxyClass = ClassUtils::getRealClass($class);
264+
if ($nonProxyClass !== $class) {
265+
// we work with proxy
266+
return null;
267+
}
268+
262269
/** @var \ReflectionProperty[] $properties */
263270
$properties = $this->loadProperties($class);
264271
$accessor = $this->accessor;

0 commit comments

Comments
 (0)