diff --git a/src/EventListener/ResourceIndexListener.php b/src/EventListener/ResourceIndexListener.php index 529ea944..7c0af41a 100644 --- a/src/EventListener/ResourceIndexListener.php +++ b/src/EventListener/ResourceIndexListener.php @@ -38,7 +38,7 @@ public function updateIndex(GenericEvent $event): void Assert::isInstanceOf($resource, ResourceInterface::class); foreach ($this->persistersMap as $objectPersisterId => $modelClass) { - if ($modelClass === get_class($resource)) { + if ($resource instanceof $modelClass) { $this->resourceRefresher->refresh($resource, $objectPersisterId); } }