Skip to content

Commit

Permalink
Merge pull request #25 from bourvill/fix-reflection-rollback
Browse files Browse the repository at this point in the history
ReflectionProperty fix if $object is ProxyObject
  • Loading branch information
makasim authored Mar 5, 2020
2 parents fbdc605 + 55598a6 commit 607f0d3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Doctrine/SyncIndexWithObjectChangeListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,11 @@ private function sendUpdateIndexMessage($action, $id)
/**
* @param $object
* @return mixed
* @throws \ReflectionException
*/
private function extractId($object)
{
$rp = new \ReflectionProperty($object, $this->config['model_id']);
$rp = (new \ReflectionClass($this->modelClass))->getProperty($this->config['model_id']);
$rp->setAccessible(true);
$id = $rp->getValue($object);
$rp->setAccessible(false);
Expand Down

0 comments on commit 607f0d3

Please sign in to comment.