diff --git a/src/MessageHandler/PopulateCurrentDataTrackersHandler.php b/src/MessageHandler/PopulateCurrentDataTrackersHandler.php index 892b79c..0206feb 100644 --- a/src/MessageHandler/PopulateCurrentDataTrackersHandler.php +++ b/src/MessageHandler/PopulateCurrentDataTrackersHandler.php @@ -6,7 +6,7 @@ use Locastic\Loggastic\Bridge\Elasticsearch\Context\ElasticsearchContextFactoryInterface; use Locastic\Loggastic\Bridge\Elasticsearch\Context\Traits\ElasticNormalizationContextTrait; use Locastic\Loggastic\Bridge\Elasticsearch\ElasticsearchService; -use Locastic\Loggastic\Factory\ActivityLogInputFactory; +use Locastic\Loggastic\Factory\CurrentDataTrackerInputFactoryInterface; use Locastic\Loggastic\Message\PopulateCurrentDataTrackersMessage; use Symfony\Component\Messenger\Attribute\AsMessageHandler; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; @@ -16,7 +16,7 @@ final class PopulateCurrentDataTrackersHandler { use ElasticNormalizationContextTrait; - public function __construct(private readonly ManagerRegistry $managerRegistry, private readonly ActivityLogInputFactory $activityLogInputFactory, private readonly NormalizerInterface $objectNormalizer, private readonly ElasticsearchService $elasticService, private readonly ElasticsearchContextFactoryInterface $elasticsearchContextFactory) + public function __construct(private readonly ManagerRegistry $managerRegistry, private readonly CurrentDataTrackerInputFactoryInterface $currentDataTrackerInputFactory, private readonly NormalizerInterface $objectNormalizer, private readonly ElasticsearchService $elasticService, private readonly ElasticsearchContextFactoryInterface $elasticsearchContextFactory) { } @@ -44,7 +44,7 @@ public function __invoke(PopulateCurrentDataTrackersMessage $message): void echo 'Processing object '.$item->getId()."\r\n"; $normalizedItem = $this->objectNormalizer->normalize($item, 'activityLog', $this->getNormalizationContext($loggableContext)); - $currentDataTrackers[] = $this->activityLogInputFactory->createFromActivityLogMessage($item, $normalizedItem); + $currentDataTrackers[] = $this->currentDataTrackerInputFactory->create($item, $normalizedItem); } $elasticContext = $this->elasticsearchContextFactory->create($message->getLoggableClass());