Skip to content

Commit 607f0d3

Browse files
authored
Merge pull request #25 from bourvill/fix-reflection-rollback
ReflectionProperty fix if $object is ProxyObject
2 parents fbdc605 + 55598a6 commit 607f0d3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Doctrine/SyncIndexWithObjectChangeListener.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,11 @@ private function sendUpdateIndexMessage($action, $id)
110110
/**
111111
* @param $object
112112
* @return mixed
113+
* @throws \ReflectionException
113114
*/
114115
private function extractId($object)
115116
{
116-
$rp = new \ReflectionProperty($object, $this->config['model_id']);
117+
$rp = (new \ReflectionClass($this->modelClass))->getProperty($this->config['model_id']);
117118
$rp->setAccessible(true);
118119
$id = $rp->getValue($object);
119120
$rp->setAccessible(false);

0 commit comments

Comments
 (0)