---
title: Magento Implementation
slug: klevu-magento-v4/magento-implementation
docTags: 
createdAt: 2025-02-27T10:29:19.266Z
---

When we trigger a sync from Magento, whether via cron or CLI, `Klevu\Indexing\Service\EntitySyncOrchestratorService::execute` is executed.&#x20;

This loops through all `entityIndexerServices`.&#x20;

These `entityIndexerServices` are injected via `di.xml` from each entity indexing module  (`module-m2-indexing-categories`, `module-m2-indexing-cms`, `module-ms-indexing-products`).

e.g. from `module-ms-indexing-products/etc/di.xml`

```xml
<type name="Klevu\Indexing\Service\EntitySyncOrchestratorService">
    <arguments>
        <argument name="entityIndexerServices" xsi:type="array">
            <item name="KLEVU_PRODUCT" xsi:type="array">
                <item name="add"
                      xsi:type="object">Klevu\IndexingProducts\Service\EntityIndexerService\Add</item>
                ...
            </item>
        </argument>
    </arguments>
</type> 
```

The injected `EntityIndexerService` is a virtual type, into which we pass an `EntityIndexingRecordProvider` and a pipeline YAML file.

```xml
<virtualType name="Klevu\IndexingProducts\Service\EntityIndexerService\Add"
             type="Klevu\IndexingProducts\Service\EntityIndexerService">
    <arguments>
        <argument name="entityIndexingRecordProvider"
                  xsi:type="object">Klevu\IndexingProducts\Service\Provider\Sync\EntityIndexingRecordProvider\Add</argument>
        <argument name="pipelineConfigurationFilepath"
                  xsi:type="string">Klevu_IndexingProducts::etc/pipeline/add_update.yml</argument>
    </arguments>
</virtualType> 
```

:::hint{type="info"}
The `EntityIndexingRecordProvider` will provide the records to index.
The `pipelineConfigurationFilepath` contains the default yaml file containing instructions on how to process those records.
:::

