metadataPool = $metadataPool; $this->externalFKSetup = $externalFKSetup; } /** * {@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(), ResourceProduct::TABLE_NAME, 'category_id' ); $metadata = $this->metadataPool->getMetadata(ProductInterface::class); $this->externalFKSetup->install( $installer, $metadata->getEntityTable(), $metadata->getIdentifierField(), 'catalog_url_rewrite_product_category', 'product_id' ); $installer->endSetup(); } }