Skip to content

Commit

Permalink
Update src/Doctrine/EventListener/PurgeHttpCacheListener.php
Browse files Browse the repository at this point in the history
Co-authored-by: Antoine Bluchet <soyuka@users.noreply.github.com>
  • Loading branch information
wtfzdotnet and soyuka committed Apr 23, 2024
1 parent 7aaafa1 commit f3a4016
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Doctrine/EventListener/PurgeHttpCacheListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function preUpdate(PreUpdateEventArgs $eventArgs): void
$changeSet = $eventArgs->getEntityChangeSet();
// @phpstan-ignore-next-line
$objectManager = method_exists($eventArgs, 'getObjectManager') ? $eventArgs->getObjectManager() : $eventArgs->getEntityManager();
$associationMappings = $objectManager->getClassMetadata($objectManager->getClassMetadata(get_class($entity))->getName())->getAssociationMappings();
$associationMappings = $objectManager->getClassMetadata(get_class($eventArgs->getObject())->getAssociationMappings();

foreach ($changeSet as $key => $value) {
if (!isset($associationMappings[$key])) {
Expand Down

0 comments on commit f3a4016

Please sign in to comment.