/** * {@inheritdoc} */ protected function transformData($data, $sourceDocument, $destDocument, $recordTransformer, $destinationRecords) { parent::transformData($data, $sourceDocument, $destDocument, $recordTransformer, $destinationRecords); /** @var \Magento\Framework\DB\Adapter\Pdo\Mysql $adapter */ $adapter = $this->destination->getAdapter()->getSelect()->getAdapter(); $entityType = $this->helper->getEntityTypeData('entity_type_id', $data['entity_type_id']); $incrementMaxNumber = $this->helper->getMaxIncrementForEntityType($data['entity_type_id']); if ($incrementMaxNumber === false) { return; } foreach ($this->helper->getStoreIds() as $storeId) { $tableName = $this->helper->getTableName($entityType['entity_type_table'], $storeId); $adapter->insertOnDuplicate($tableName, [$entityType['column'] => $incrementMaxNumber]); } }
/** * {@inheritdoc} */ public function perform() { $this->progressBar->start(1, LogManager::LOG_LEVEL_INFO); $this->progressBar->advance(LogManager::LOG_LEVEL_INFO); $this->destination->clearDocument($this->helper->getSequenceMetaTable()); $this->destination->clearDocument($this->helper->getSequenceProfileTable()); foreach ($this->helper->getEntityTypeTablesMap() as $entityType) { foreach ($this->helper->getStoreIds() as $storeId) { $this->createSequenceTable($entityType, $storeId); $metaId = $this->addDataMetaTable($entityType, $storeId); $this->addDataProfileTable($storeId, $metaId); } } $this->progressBar->finish(LogManager::LOG_LEVEL_INFO); return true; }