/** * {@inheritdoc} */ public function install(SchemaSetupInterface $setup, ModuleContextInterface $context) { $installer = $setup; $installer->startSetup(); $metadata = $this->metadataPool->getMetadata(CategoryInterface::class); $this->externalFKSetup->install($installer, $metadata->getEntityTable(), $metadata->getIdentifierField(), 'catalog_category_product', 'category_id'); $installer->endSetup(); }
/** * Add external foreign keys * * @param SchemaSetupInterface $installer * @return void * @throws \Exception */ protected function addExternalForeignKeys(SchemaSetupInterface $installer) { $metadata = $this->metadataPool->getMetadata(ProductInterface::class); $this->externalFKSetup->install($installer, $metadata->getEntityTable(), $metadata->getIdentifierField(), 'cataloginventory_stock_item', 'product_id'); }
/** * Add external foreign keys * * @param SchemaSetupInterface $installer * @param string $tableName * @param string $columnName * @return void * @throws \Exception */ protected function addExternalForeignKeys(SchemaSetupInterface $installer, $tableName, $columnName) { $metadata = $this->metadataPool->getMetadata(ProductInterface::class); $this->externalFKSetup->install($installer, $metadata->getEntityTable(), $metadata->getIdentifierField(), $tableName, $columnName); }