Esempio n. 1
0
 /**
  * {@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();
 }
Esempio n. 2
0
 /**
  * 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');
 }
Esempio n. 3
0
 /**
  * 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);
 }