Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
module-bundle
Setup
Recurring.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Bundle\Setup
;
7
8
use
Magento\Framework\Setup\ExternalFKSetup
;
9
use
Magento\Framework\Setup\InstallSchemaInterface
;
10
use
Magento\Framework\Setup\ModuleContextInterface
;
11
use
Magento\Framework\Setup\SchemaSetupInterface
;
12
use
Magento\Framework\EntityManager\MetadataPool
;
13
use
Magento\Catalog\Api\Data\ProductInterface
;
14
18
class
Recurring
implements
InstallSchemaInterface
19
{
23
protected
$metadataPool
;
24
28
protected
$externalFKSetup
;
29
34
public
function
__construct
(
35
MetadataPool
$metadataPool
,
36
ExternalFKSetup
$externalFKSetup
37
) {
38
$this->metadataPool =
$metadataPool
;
39
$this->externalFKSetup =
$externalFKSetup
;
40
}
41
45
public
function
install
(
SchemaSetupInterface
$setup
,
ModuleContextInterface
$context)
46
{
47
$installer
=
$setup
;
48
$installer
->startSetup();
49
50
$listTables = [
51
'catalog_product_bundle_price_index'
=>
'entity_id'
,
52
'catalog_product_bundle_selection'
=>
'product_id'
,
53
];
54
foreach
($listTables as
$tableName
=> $columnName) {
55
$this->
addExternalForeignKeys
(
$installer
,
$tableName
, $columnName);
56
}
57
58
$installer
->endSetup();
59
}
60
70
protected
function
addExternalForeignKeys
(
SchemaSetupInterface
$installer
,
$tableName
, $columnName)
71
{
72
$metadata = $this->metadataPool->getMetadata(ProductInterface::class);
73
$this->externalFKSetup->install(
74
$installer
,
75
$metadata->getEntityTable(),
76
$metadata->getIdentifierField(),
77
$tableName
,
78
$columnName
79
);
80
}
81
}
$tableName
$tableName
Definition:
trigger.php:13
$installer
$installer
Definition:
configurable_attribute.php:16
Magento\Framework\Setup\ModuleContextInterface
Definition:
ModuleContextInterface.php:13
Magento\Bundle\Setup
Magento\Framework\Setup\SchemaSetupInterface
Definition:
SchemaSetupInterface.php:13
Magento\Bundle\Setup\Recurring\__construct
__construct(MetadataPool $metadataPool, ExternalFKSetup $externalFKSetup)
Definition:
Recurring.php:34
Magento\Framework\EntityManager\MetadataPool
Definition:
MetadataPool.php:18
Magento\Bundle\Setup\Recurring\addExternalForeignKeys
addExternalForeignKeys(SchemaSetupInterface $installer, $tableName, $columnName)
Definition:
Recurring.php:70
Magento\Bundle\Setup\Recurring\install
install(SchemaSetupInterface $setup, ModuleContextInterface $context)
Definition:
Recurring.php:45
Magento\Framework\Setup\ExternalFKSetup
Definition:
ExternalFKSetup.php:13
$setup
$setup
Definition:
trigger.php:12
Magento\Bundle\Setup\Recurring\$externalFKSetup
$externalFKSetup
Definition:
Recurring.php:28
Magento\Bundle\Setup\Recurring\$metadataPool
$metadataPool
Definition:
Recurring.php:23
Magento\Catalog\Api\Data\ProductInterface
Definition:
ProductInterface.php:14
Magento\Framework\Setup\InstallSchemaInterface
Definition:
InstallSchemaInterface.php:14
Magento\Bundle\Setup\Recurring
Definition:
Recurring.php:18