diff --git a/src/module-vsbridge-indexer-catalog/Index/Mapping/AbstractMapping.php b/src/module-vsbridge-indexer-catalog/Index/Mapping/AbstractMapping.php index 8ccf2470..50b5e8af 100644 --- a/src/module-vsbridge-indexer-catalog/Index/Mapping/AbstractMapping.php +++ b/src/module-vsbridge-indexer-catalog/Index/Mapping/AbstractMapping.php @@ -13,16 +13,17 @@ abstract class AbstractMapping /** * @var array */ - private $staticFieldMapping = [ - 'status' => FieldInterface::TYPE_INTEGER, - 'visibility' => FieldInterface::TYPE_INTEGER, - 'position' => FieldInterface::TYPE_LONG, - 'level' => FieldInterface::TYPE_INTEGER, - 'category_ids' => FieldInterface::TYPE_LONG, - 'sku' => FieldInterface::TYPE_KEYWORD, - 'url_path' => FieldInterface::TYPE_KEYWORD, - 'url_key' => FieldInterface::TYPE_KEYWORD, - ]; + private $staticFieldMapping; + + /** + * AbstractMapping constructor. + * + * @param array $staticFieldMapping + */ + public function __construct(array $staticFieldMapping) + { + $this->staticFieldMapping = $staticFieldMapping; + } /** * @var array diff --git a/src/module-vsbridge-indexer-catalog/Index/Mapping/Category.php b/src/module-vsbridge-indexer-catalog/Index/Mapping/Category.php index a028495d..82b73730 100644 --- a/src/module-vsbridge-indexer-catalog/Index/Mapping/Category.php +++ b/src/module-vsbridge-indexer-catalog/Index/Mapping/Category.php @@ -20,7 +20,6 @@ */ class Category extends AbstractMapping implements MappingInterface { - /** * @var array */ @@ -61,17 +60,20 @@ class Category extends AbstractMapping implements MappingInterface * @param GeneralMapping $generalMapping * @param CategoryChildAttributes $categoryChildAttributes * @param AttributeDataProvider $resourceModel + * @param array $staticFieldMapping */ public function __construct( EventManager $eventManager, GeneralMapping $generalMapping, CategoryChildAttributes $categoryChildAttributes, - AttributeDataProvider $resourceModel + AttributeDataProvider $resourceModel, + array $staticFieldMapping ) { $this->eventManager = $eventManager; $this->generalMapping = $generalMapping; $this->resourceModel = $resourceModel; $this->childAttributes = $categoryChildAttributes; + parent::__construct($staticFieldMapping); } /** diff --git a/src/module-vsbridge-indexer-catalog/Index/Mapping/Product.php b/src/module-vsbridge-indexer-catalog/Index/Mapping/Product.php index 7de16585..06f9e2fc 100644 --- a/src/module-vsbridge-indexer-catalog/Index/Mapping/Product.php +++ b/src/module-vsbridge-indexer-catalog/Index/Mapping/Product.php @@ -14,7 +14,6 @@ */ class Product extends AbstractMapping implements MappingInterface { - /** * @var EventManager */ @@ -52,12 +51,14 @@ public function __construct( EventManager $eventManager, GeneralMapping $generalMapping, ConfigurableAttributes $configurableAttributes, - AttributeDataProvider $resourceModel + AttributeDataProvider $resourceModel, + array $staticFieldMapping ) { $this->eventManager = $eventManager; $this->generalMapping = $generalMapping; $this->resourceModel = $resourceModel; $this->configurableAttributes = $configurableAttributes; + parent::__construct($staticFieldMapping); } /** diff --git a/src/module-vsbridge-indexer-catalog/etc/di.xml b/src/module-vsbridge-indexer-catalog/etc/di.xml index b67f5743..adb17d3b 100644 --- a/src/module-vsbridge-indexer-catalog/etc/di.xml +++ b/src/module-vsbridge-indexer-catalog/etc/di.xml @@ -137,4 +137,18 @@ + + + + Divante\VsbridgeIndexerCore\Api\Mapping\FieldInterface::TYPE_INTEGER + Divante\VsbridgeIndexerCore\Api\Mapping\FieldInterface::TYPE_INTEGER + Divante\VsbridgeIndexerCore\Api\Mapping\FieldInterface::TYPE_LONG + Divante\VsbridgeIndexerCore\Api\Mapping\FieldInterface::TYPE_INTEGER + Divante\VsbridgeIndexerCore\Api\Mapping\FieldInterface::TYPE_LONG + Divante\VsbridgeIndexerCore\Api\Mapping\FieldInterface::TYPE_KEYWORD + Divante\VsbridgeIndexerCore\Api\Mapping\FieldInterface::TYPE_KEYWORD + Divante\VsbridgeIndexerCore\Api\Mapping\FieldInterface::TYPE_KEYWORD + + +