Skip to content

Commit

Permalink
Merge pull request #1292 from 1ed/fix-remove-listener
Browse files Browse the repository at this point in the history
Fix remove listener if property namer is used
  • Loading branch information
garak committed Jun 29, 2022
2 parents 44fdfbc + 3e8eb6a commit 6b8ac89
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/EventListener/Doctrine/RemoveListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function preRemove(EventArgs $event): void
if ($object instanceof Proxy) {
$object->__load();
}
$this->entities[] = $object;
$this->entities[] = clone $object;
}
}

Expand All @@ -54,5 +54,6 @@ public function postFlush(): void
$this->handler->remove($object, $field);
}
}
$this->entities = [];
}
}

0 comments on commit 6b8ac89

Please sign in to comment.