Skip to content

Commit 1ea51de

Browse files
authored
Merge pull request #23 from IvanBinzz/patch-1
ReflectionProperty fix if $object is ProxyObject
2 parents 63b79f1 + 1e0bb14 commit 1ea51de

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Doctrine/SyncIndexWithObjectChangeListener.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,11 @@ private function sendUpdateIndexMessage($action, LifecycleEventArgs $args)
8585
{
8686
$object = $args->getObject();
8787

88-
$rp = new \ReflectionProperty($object, $this->config['model_id']);
88+
$rp = (new \ReflectionClass($this->modelClass))->getProperty($this->config['model_id']);
8989
$rp->setAccessible(true);
9090
$id = $rp->getValue($object);
9191
$rp->setAccessible(false);
92-
92+
9393
$queue = $this->context->createQueue(Commands::SYNC_INDEX_WITH_OBJECT_CHANGE);
9494

9595
$message = $this->context->createMessage(JSON::encode([

0 commit comments

Comments
 (0)