Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Recurring.php
Go to the documentation of this file.
1 <?php
6 namespace Magento\Catalog\Setup;
7 
14 
19 {
23  protected $metadataPool;
24 
28  protected $externalFKSetup;
29 
34  public function __construct(
37  ) {
38  $this->metadataPool = $metadataPool;
39  $this->externalFKSetup = $externalFKSetup;
40  }
41 
46  {
48  $installer->startSetup();
49 
50  $metadata = $this->metadataPool->getMetadata(CategoryInterface::class);
51  $this->externalFKSetup->install(
52  $installer,
53  $metadata->getEntityTable(),
54  $metadata->getIdentifierField(),
55  'catalog_category_product',
56  'category_id'
57  );
58 
59  $installer->endSetup();
60  }
61 }
__construct(MetadataPool $metadataPool, ExternalFKSetup $externalFKSetup)
Definition: Recurring.php:34
install(SchemaSetupInterface $setup, ModuleContextInterface $context)
Definition: Recurring.php:45
$setup
Definition: trigger.php:12