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
7 
16 
21 {
25  protected $metadataPool;
26 
30  protected $externalFKSetup;
31 
36  public function __construct(
39  ) {
40  $this->metadataPool = $metadataPool;
41  $this->externalFKSetup = $externalFKSetup;
42  }
43 
48  {
50  $installer->startSetup();
51 
52  $metadata = $this->metadataPool->getMetadata(CategoryInterface::class);
53  $this->externalFKSetup->install(
54  $installer,
55  $metadata->getEntityTable(),
56  $metadata->getIdentifierField(),
57  ResourceProduct::TABLE_NAME,
58  'category_id'
59  );
60 
61  $metadata = $this->metadataPool->getMetadata(ProductInterface::class);
62  $this->externalFKSetup->install(
63  $installer,
64  $metadata->getEntityTable(),
65  $metadata->getIdentifierField(),
66  'catalog_url_rewrite_product_category',
67  'product_id'
68  );
69 
70  $installer->endSetup();
71  }
72 }
__construct(MetadataPool $metadataPool, ExternalFKSetup $externalFKSetup)
Definition: Recurring.php:36
install(SchemaSetupInterface $setup, ModuleContextInterface $context)
Definition: Recurring.php:47
$setup
Definition: trigger.php:12