Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/EventListener/Doctrine/EntityListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Setono\SyliusMeilisearchPlugin\Message\Command\IndexEntity;
use Setono\SyliusMeilisearchPlugin\Message\Command\RemoveEntity;
use Setono\SyliusMeilisearchPlugin\Model\IndexableInterface;
use Sylius\Component\Resource\Model\TranslationInterface;
use Symfony\Component\Messenger\MessageBusInterface;

final class EntityListener
Expand Down Expand Up @@ -37,6 +38,11 @@
private function dispatch(LifecycleEventArgs $eventArgs, callable $message): void
{
$obj = $eventArgs->getObject();

if ($obj instanceof TranslationInterface) {
$obj = $obj->getTranslatable();

Check warning on line 43 in src/EventListener/Doctrine/EntityListener.php

View check run for this annotation

Codecov / codecov/patch

src/EventListener/Doctrine/EntityListener.php#L42-L43

Added lines #L42 - L43 were not covered by tests
}

if (!$obj instanceof IndexableInterface) {
return;
}
Expand Down
Loading