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-catalog-inventory
Setup
Recurring.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\CatalogInventory\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
$this->
addExternalForeignKeys
(
$installer
);
51
52
$installer
->endSetup();
53
}
54
62
protected
function
addExternalForeignKeys
(
SchemaSetupInterface
$installer
)
63
{
64
$metadata = $this->metadataPool->getMetadata(ProductInterface::class);
65
$this->externalFKSetup->install(
66
$installer
,
67
$metadata->getEntityTable(),
68
$metadata->getIdentifierField(),
69
'cataloginventory_stock_item'
,
70
'product_id'
71
);
72
}
73
}
$installer
$installer
Definition:
configurable_attribute.php:16
Magento\CatalogInventory\Setup\Recurring\$metadataPool
$metadataPool
Definition:
Recurring.php:23
Magento\CatalogInventory\Setup\Recurring\install
install(SchemaSetupInterface $setup, ModuleContextInterface $context)
Definition:
Recurring.php:45
Magento\CatalogInventory\Setup\Recurring\$externalFKSetup
$externalFKSetup
Definition:
Recurring.php:28
Magento\Framework\Setup\ModuleContextInterface
Definition:
ModuleContextInterface.php:13
Magento\CatalogInventory\Setup
Magento\Framework\Setup\SchemaSetupInterface
Definition:
SchemaSetupInterface.php:13
Magento\CatalogInventory\Setup\Recurring\addExternalForeignKeys
addExternalForeignKeys(SchemaSetupInterface $installer)
Definition:
Recurring.php:62
Magento\Framework\EntityManager\MetadataPool
Definition:
MetadataPool.php:18
Magento\CatalogInventory\Setup\Recurring
Definition:
Recurring.php:18
Magento\Framework\Setup\ExternalFKSetup
Definition:
ExternalFKSetup.php:13
$setup
$setup
Definition:
trigger.php:12
Magento\Catalog\Api\Data\ProductInterface
Definition:
ProductInterface.php:14
Magento\Framework\Setup\InstallSchemaInterface
Definition:
InstallSchemaInterface.php:14
Magento\CatalogInventory\Setup\Recurring\__construct
__construct(MetadataPool $metadataPool, ExternalFKSetup $externalFKSetup)
Definition:
Recurring.php:34