/** * @param array $entityType * @param int $storeId * @return int */ protected function addDataMetaTable(array $entityType, $storeId) { $data = ['entity_type' => $entityType['entity_type_code'], 'store_id' => $storeId, 'sequence_table' => $this->helper->getTableName($entityType['entity_type_table'], $storeId)]; /** @var \Magento\Framework\DB\Adapter\Pdo\Mysql $adapter */ $adapter = $this->destination->getAdapter()->getSelect()->getAdapter(); $adapter->insert($this->helper->getTableName($this->helper->getSequenceMetaTable()), $data); return $adapter->lastInsertId($this->helper->getTableName($this->helper->getSequenceMetaTable()), 'meta_id'); }
/** * {@inheritdoc} */ public function perform() { $this->progress->start(1); $this->progress->advance(); if (!$this->destination->getDocument($this->helper->getSequenceProfileTable())) { $this->missingDocuments[MapInterface::TYPE_DEST][$this->helper->getSequenceProfileTable()] = true; } else { $structureExistingSequenceProfileTable = array_keys($this->destination->getDocument($this->helper->getSequenceProfileTable())->getStructure()->getFields()); $this->checkStructure($this->helper->getSequenceProfileTable(), $this->helper->getSequenceProfileTable(true), $structureExistingSequenceProfileTable); } if (!$this->destination->getDocument($this->helper->getSequenceMetaTable())) { $this->missingDocuments[MapInterface::TYPE_DEST][$this->helper->getSequenceMetaTable()] = true; } else { $structureExistingSequenceMetaTable = array_keys($this->destination->getDocument($this->helper->getSequenceMetaTable())->getStructure()->getFields()); $this->checkStructure($this->helper->getSequenceMetaTable(), $this->helper->getSequenceMetaTable(true), $structureExistingSequenceMetaTable); } $this->progress->finish(); return $this->checkForErrors(); }