From cba74cf4a9e1733f5dfadcfafdcf11a9162dbc97 Mon Sep 17 00:00:00 2001 From: Serhiy Shkolyarenko Date: Fri, 23 Jan 2015 19:19:09 +0200 Subject: [PATCH 01/44] MAGETWO-31872: Storage configuration and foreign keys replace updated constructors to support connection prefix cherry picks of Olexii Korshenko and Serhiy Dzhepa commits --- .../Magento/Authorization/Model/Resource/Role.php | 6 ++++-- .../Magento/Authorization/Model/Resource/Rules.php | 6 ++++-- app/code/Magento/Bundle/Model/Resource/Bundle.php | 6 ++++-- app/code/Magento/Bundle/Model/Resource/Option.php | 6 ++++-- app/code/Magento/Captcha/Model/Resource/Log.php | 6 ++++-- .../Magento/Catalog/Model/Resource/Attribute.php | 6 ++++-- .../Catalog/Model/Resource/Category/Flat.php | 6 ++++-- app/code/Magento/Catalog/Model/Resource/Config.php | 6 ++++-- .../Catalog/Model/Resource/Layer/Filter/Price.php | 6 ++++-- .../Catalog/Model/Resource/Product/Flat.php | 6 ++++-- .../Resource/Product/Indexer/AbstractIndexer.php | 10 +++++++--- .../Resource/Product/Indexer/Eav/AbstractEav.php | 6 ++++-- .../Model/Resource/Product/Indexer/Eav/Source.php | 6 ++++-- .../Product/Indexer/Price/DefaultPrice.php | 6 ++++-- .../Catalog/Model/Resource/Product/Link.php | 10 +++++++--- .../Catalog/Model/Resource/Product/Option.php | 6 ++++-- .../Model/Resource/Product/Option/Value.php | 6 ++++-- .../Catalog/Model/Resource/Product/Website.php | 6 ++++-- app/code/Magento/Catalog/Model/Resource/Url.php | 6 ++++-- .../Model/Resource/Indexer/Stock/DefaultStock.php | 6 ++++-- .../CatalogInventory/Model/Resource/Stock.php | 6 ++++-- .../CatalogInventory/Model/Resource/Stock/Item.php | 6 ++++-- .../Model/Resource/Stock/Status.php | 6 ++++-- .../Magento/CatalogRule/Model/Resource/Rule.php | 6 ++++-- .../CatalogSearch/Model/Resource/Advanced.php | 6 ++++-- .../CatalogSearch/Model/Resource/Engine.php | 6 ++++-- .../CatalogSearch/Model/Resource/Fulltext.php | 6 ++++-- .../Model/Resource/Agreement.php | 10 +++++++--- app/code/Magento/Cms/Model/Resource/Block.php | 6 ++++-- app/code/Magento/Cms/Model/Resource/Page.php | 6 ++++-- .../Model/Resource/Product/Type/Configurable.php | 6 ++++-- .../Product/Type/Configurable/Attribute.php | 6 ++++-- app/code/Magento/Core/Model/Resource/Design.php | 10 +++++++--- .../Core/Model/Resource/File/Storage/Database.php | 10 +++++++--- .../Magento/Core/Model/Resource/Layout/Update.php | 10 +++++++--- app/code/Magento/Customer/Model/Resource/Group.php | 6 ++++-- .../Magento/Customer/Model/Resource/Visitor.php | 6 ++++-- .../Resource/Import/CustomerComposite/Data.php | 4 +++- .../DesignEditor/Model/Theme/Resource/Change.php | 11 +++++++---- .../Magento/Directory/Model/Resource/Region.php | 10 +++++++--- .../Magento/Downloadable/Model/Resource/Link.php | 6 ++++-- .../Eav/Model/Resource/Entity/Attribute.php | 6 ++++-- .../Eav/Model/Resource/Entity/Attribute/Set.php | 6 ++++-- app/code/Magento/Email/Model/Resource/Template.php | 10 +++++++--- .../ImportExport/Model/Resource/Import/Data.php | 4 +++- .../Integration/Model/Resource/Oauth/Consumer.php | 10 +++++++--- .../Integration/Model/Resource/Oauth/Token.php | 10 +++++++--- app/code/Magento/Log/Model/Resource/Log.php | 6 ++++-- app/code/Magento/Log/Model/Resource/Visitor.php | 6 ++++-- .../Magento/Log/Model/Resource/Visitor/Online.php | 10 +++++++--- .../Magento/Newsletter/Model/Resource/Queue.php | 6 ++++-- .../Newsletter/Model/Resource/Subscriber.php | 6 ++++-- .../Magento/Newsletter/Model/Resource/Template.php | 10 +++++++--- .../Model/Resource/Carrier/Tablerate.php | 6 ++++-- .../Magento/Persistent/Model/Resource/Session.php | 6 ++++-- .../Magento/ProductAlert/Model/Resource/Price.php | 10 +++++++--- .../Magento/ProductAlert/Model/Resource/Stock.php | 10 +++++++--- app/code/Magento/Reports/Model/Resource/Event.php | 6 ++++-- .../Model/Resource/Product/Index/AbstractIndex.php | 6 ++++-- .../Model/Resource/Report/AbstractReport.php | 6 ++++-- .../Model/Resource/Report/Product/Viewed.php | 14 ++++++++++++-- app/code/Magento/Review/Model/Resource/Rating.php | 6 ++++-- .../Review/Model/Resource/Rating/Option.php | 6 ++++-- app/code/Magento/Review/Model/Resource/Review.php | 6 ++++-- .../Magento/Sales/Model/Resource/AbstractGrid.php | 8 -------- app/code/Magento/Sales/Model/Resource/Entity.php | 4 +++- app/code/Magento/Sales/Model/Resource/Order.php | 6 ++++-- .../Magento/Sales/Model/Resource/Order/Address.php | 6 ++++-- .../Sales/Model/Resource/Order/Creditmemo.php | 6 ++++-- .../Model/Resource/Order/Creditmemo/Comment.php | 6 ++++-- .../Magento/Sales/Model/Resource/Order/Invoice.php | 6 ++++-- .../Sales/Model/Resource/Order/Invoice/Comment.php | 6 ++++-- .../Sales/Model/Resource/Order/Shipment.php | 6 ++++-- .../Model/Resource/Order/Shipment/Comment.php | 6 ++++-- .../Sales/Model/Resource/Order/Shipment/Track.php | 6 ++++-- .../Magento/Sales/Model/Resource/Order/Status.php | 6 ++++-- .../Sales/Model/Resource/Order/Status/History.php | 7 ++++--- app/code/Magento/Sales/Model/Resource/Quote.php | 6 ++++-- .../Magento/Sales/Model/Resource/Quote/Payment.php | 9 --------- .../Sales/Model/Resource/Report/Bestsellers.php | 12 +++++++++++- .../Magento/Sales/Model/Resource/Report/Order.php | 13 +++++++++++-- .../SalesRule/Model/Resource/Report/Rule.php | 14 ++++++++++++-- app/code/Magento/SalesRule/Model/Resource/Rule.php | 6 ++++-- app/code/Magento/Search/Model/Resource/Query.php | 6 ++++-- .../Sitemap/Model/Resource/Catalog/Category.php | 6 ++++-- .../Sitemap/Model/Resource/Catalog/Product.php | 6 ++++-- .../Magento/Tax/Model/Resource/Calculation.php | 6 ++++-- app/code/Magento/Tax/Model/Resource/Report/Tax.php | 14 ++++++++++++-- .../Magento/Translation/Model/Resource/String.php | 4 +++- .../Translation/Model/Resource/Translate.php | 4 +++- app/code/Magento/User/Model/Resource/User.php | 6 ++++-- .../Model/Resource/Attribute/Backend/Weee/Tax.php | 6 ++++-- app/code/Magento/Weee/Model/Resource/Tax.php | 10 +++++++--- lib/internal/Magento/Framework/App/Resource.php | 5 +++-- .../Framework/Model/Resource/Db/AbstractDb.php | 9 +++++++-- 95 files changed, 455 insertions(+), 215 deletions(-) diff --git a/app/code/Magento/Authorization/Model/Resource/Role.php b/app/code/Magento/Authorization/Model/Resource/Role.php index e1bd73002af02..410957f7843da 100644 --- a/app/code/Magento/Authorization/Model/Resource/Role.php +++ b/app/code/Magento/Authorization/Model/Resource/Role.php @@ -35,14 +35,16 @@ class Role extends \Magento\Framework\Model\Resource\Db\AbstractDb * @param \Magento\Framework\App\Resource $resource * @param \Magento\Framework\App\CacheInterface $cache * @param \Magento\Framework\Stdlib\DateTime $dateTime + * @param string|null $resourcePrefix */ public function __construct( \Magento\Framework\App\Resource $resource, \Magento\Framework\App\CacheInterface $cache, - \Magento\Framework\Stdlib\DateTime $dateTime + \Magento\Framework\Stdlib\DateTime $dateTime, + $resourcePrefix = null ) { $this->dateTime = $dateTime; - parent::__construct($resource); + parent::__construct($resource, $resourcePrefix); $this->_cache = $cache->getFrontend(); } diff --git a/app/code/Magento/Authorization/Model/Resource/Rules.php b/app/code/Magento/Authorization/Model/Resource/Rules.php index 79ecf007b8fd6..0c5f325843614 100644 --- a/app/code/Magento/Authorization/Model/Resource/Rules.php +++ b/app/code/Magento/Authorization/Model/Resource/Rules.php @@ -40,16 +40,18 @@ class Rules extends \Magento\Framework\Model\Resource\Db\AbstractDb * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Acl\RootResource $rootResource * @param \Magento\Framework\Acl\CacheInterface $aclCache + * @param string|null $resourcePrefix */ public function __construct( \Magento\Framework\App\Resource $resource, \Magento\Framework\Acl\Builder $aclBuilder, \Psr\Log\LoggerInterface $logger, \Magento\Framework\Acl\RootResource $rootResource, - \Magento\Framework\Acl\CacheInterface $aclCache + \Magento\Framework\Acl\CacheInterface $aclCache, + $resourcePrefix = null ) { $this->_aclBuilder = $aclBuilder; - parent::__construct($resource); + parent::__construct($resource, $resourcePrefix); $this->_rootResource = $rootResource; $this->_aclCache = $aclCache; $this->_logger = $logger; diff --git a/app/code/Magento/Bundle/Model/Resource/Bundle.php b/app/code/Magento/Bundle/Model/Resource/Bundle.php index 6ab2819adfb0c..63b4def370f54 100644 --- a/app/code/Magento/Bundle/Model/Resource/Bundle.php +++ b/app/code/Magento/Bundle/Model/Resource/Bundle.php @@ -20,12 +20,14 @@ class Bundle extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource * @param \Magento\Catalog\Model\Resource\Product\Relation $productRelation + * @param string|null $resourcePrefix */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Catalog\Model\Resource\Product\Relation $productRelation + \Magento\Catalog\Model\Resource\Product\Relation $productRelation, + $resourcePrefix = null ) { - parent::__construct($resource); + parent::__construct($resource, $resourcePrefix); $this->_productRelation = $productRelation; } diff --git a/app/code/Magento/Bundle/Model/Resource/Option.php b/app/code/Magento/Bundle/Model/Resource/Option.php index 6e7b744f1d32a..b557ffec2c64a 100644 --- a/app/code/Magento/Bundle/Model/Resource/Option.php +++ b/app/code/Magento/Bundle/Model/Resource/Option.php @@ -20,12 +20,14 @@ class Option extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource * @param \Magento\Bundle\Model\Option\Validator $validator + * @param string|null $resourcePrefix */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Bundle\Model\Option\Validator $validator + \Magento\Bundle\Model\Option\Validator $validator, + $resourcePrefix = null ) { - parent::__construct($resource); + parent::__construct($resource, $resourcePrefix); $this->validator = $validator; } diff --git a/app/code/Magento/Captcha/Model/Resource/Log.php b/app/code/Magento/Captcha/Model/Resource/Log.php index 11647904b6f65..609fa3f95971d 100644 --- a/app/code/Magento/Captcha/Model/Resource/Log.php +++ b/app/code/Magento/Captcha/Model/Resource/Log.php @@ -38,15 +38,17 @@ class Log extends \Magento\Framework\Model\Resource\Db\AbstractDb * @param \Magento\Framework\App\Resource $resource * @param \Magento\Framework\Stdlib\DateTime\DateTime $coreDate * @param \Magento\Framework\HTTP\PhpEnvironment\RemoteAddress $remoteAddress + * @param string|null $resourcePrefix */ public function __construct( \Magento\Framework\App\Resource $resource, \Magento\Framework\Stdlib\DateTime\DateTime $coreDate, - \Magento\Framework\HTTP\PhpEnvironment\RemoteAddress $remoteAddress + \Magento\Framework\HTTP\PhpEnvironment\RemoteAddress $remoteAddress, + $resourcePrefix = null ) { $this->_coreDate = $coreDate; $this->_remoteAddress = $remoteAddress; - parent::__construct($resource); + parent::__construct($resource, $resourcePrefix); } /** diff --git a/app/code/Magento/Catalog/Model/Resource/Attribute.php b/app/code/Magento/Catalog/Model/Resource/Attribute.php index 60d3c2cfe1ea6..5c1f5e6e56a36 100644 --- a/app/code/Magento/Catalog/Model/Resource/Attribute.php +++ b/app/code/Magento/Catalog/Model/Resource/Attribute.php @@ -32,17 +32,19 @@ class Attribute extends \Magento\Eav\Model\Resource\Entity\Attribute * @param \Magento\Eav\Model\Resource\Entity\Type $eavEntityType * @param \Magento\Eav\Model\Config $eavConfig * @param LockValidatorInterface $lockValidator + * @param string|null $resourcePrefix */ public function __construct( \Magento\Framework\App\Resource $resource, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Eav\Model\Resource\Entity\Type $eavEntityType, \Magento\Eav\Model\Config $eavConfig, - LockValidatorInterface $lockValidator + LockValidatorInterface $lockValidator, + $resourcePrefix = null ) { $this->attrLockValidator = $lockValidator; $this->_eavConfig = $eavConfig; - parent::__construct($resource, $storeManager, $eavEntityType); + parent::__construct($resource, $storeManager, $eavEntityType, $resourcePrefix); } /** diff --git a/app/code/Magento/Catalog/Model/Resource/Category/Flat.php b/app/code/Magento/Catalog/Model/Resource/Category/Flat.php index e18f88ff4d18a..6b0a6717ddd60 100644 --- a/app/code/Magento/Catalog/Model/Resource/Category/Flat.php +++ b/app/code/Magento/Catalog/Model/Resource/Category/Flat.php @@ -84,6 +84,7 @@ class Flat extends \Magento\Indexer\Model\Resource\AbstractResource * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Model\Config $catalogConfig * @param \Magento\Framework\Event\ManagerInterface $eventManager + * @param string|null $resourcePrefix */ public function __construct( \Magento\Framework\App\Resource $resource, @@ -91,14 +92,15 @@ public function __construct( \Magento\Catalog\Model\Resource\Category\CollectionFactory $categoryCollectionFactory, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Model\Config $catalogConfig, - \Magento\Framework\Event\ManagerInterface $eventManager + \Magento\Framework\Event\ManagerInterface $eventManager, + $resourcePrefix = null ) { $this->_categoryFactory = $categoryFactory; $this->_categoryCollectionFactory = $categoryCollectionFactory; $this->_storeManager = $storeManager; $this->_catalogConfig = $catalogConfig; $this->_eventManager = $eventManager; - parent::__construct($resource); + parent::__construct($resource, $resourcePrefix); } /** diff --git a/app/code/Magento/Catalog/Model/Resource/Config.php b/app/code/Magento/Catalog/Model/Resource/Config.php index d4abad7a0ed0c..01d96239beb6f 100644 --- a/app/code/Magento/Catalog/Model/Resource/Config.php +++ b/app/code/Magento/Catalog/Model/Resource/Config.php @@ -44,15 +44,17 @@ class Config extends \Magento\Framework\Model\Resource\Db\AbstractDb * @param \Magento\Framework\App\Resource $resource * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Eav\Model\Config $eavConfig + * @param string|null $resourcePrefix */ public function __construct( \Magento\Framework\App\Resource $resource, \Magento\Store\Model\StoreManagerInterface $storeManager, - \Magento\Eav\Model\Config $eavConfig + \Magento\Eav\Model\Config $eavConfig, + $resourcePrefix = null ) { $this->_storeManager = $storeManager; $this->_eavConfig = $eavConfig; - parent::__construct($resource); + parent::__construct($resource, $resourcePrefix); } /** diff --git a/app/code/Magento/Catalog/Model/Resource/Layer/Filter/Price.php b/app/code/Magento/Catalog/Model/Resource/Layer/Filter/Price.php index 7dfcf7810f121..26c3e20aafe65 100644 --- a/app/code/Magento/Catalog/Model/Resource/Layer/Filter/Price.php +++ b/app/code/Magento/Catalog/Model/Resource/Layer/Filter/Price.php @@ -43,19 +43,21 @@ class Price extends \Magento\Framework\Model\Resource\Db\AbstractDb * @param \Magento\Catalog\Model\Layer\Resolver $layerResolver * @param \Magento\Customer\Model\Session $session * @param \Magento\Store\Model\StoreManagerInterface $storeManager + * @param string|null $resourcePrefix */ public function __construct( \Magento\Framework\App\Resource $resource, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Catalog\Model\Layer\Resolver $layerResolver, \Magento\Customer\Model\Session $session, - \Magento\Store\Model\StoreManagerInterface $storeManager + \Magento\Store\Model\StoreManagerInterface $storeManager, + $resourcePrefix = null ) { $this->layer = $layerResolver->get(); $this->session = $session; $this->storeManager = $storeManager; $this->_eventManager = $eventManager; - parent::__construct($resource); + parent::__construct($resource, $resourcePrefix); } /** diff --git a/app/code/Magento/Catalog/Model/Resource/Product/Flat.php b/app/code/Magento/Catalog/Model/Resource/Product/Flat.php index 711a988b91a94..7b71cc0b023b6 100644 --- a/app/code/Magento/Catalog/Model/Resource/Product/Flat.php +++ b/app/code/Magento/Catalog/Model/Resource/Product/Flat.php @@ -39,15 +39,17 @@ class Flat extends \Magento\Framework\Model\Resource\Db\AbstractDb * @param \Magento\Framework\App\Resource $resource * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Model\Config $catalogConfig + * @param string|null $resourcePrefix */ public function __construct( \Magento\Framework\App\Resource $resource, \Magento\Store\Model\StoreManagerInterface $storeManager, - \Magento\Catalog\Model\Config $catalogConfig + \Magento\Catalog\Model\Config $catalogConfig, + $resourcePrefix = null ) { $this->_storeManager = $storeManager; $this->_catalogConfig = $catalogConfig; - parent::__construct($resource); + parent::__construct($resource, $resourcePrefix); } /** diff --git a/app/code/Magento/Catalog/Model/Resource/Product/Indexer/AbstractIndexer.php b/app/code/Magento/Catalog/Model/Resource/Product/Indexer/AbstractIndexer.php index a360808a064a7..b9aaaeb0fe9ec 100644 --- a/app/code/Magento/Catalog/Model/Resource/Product/Indexer/AbstractIndexer.php +++ b/app/code/Magento/Catalog/Model/Resource/Product/Indexer/AbstractIndexer.php @@ -24,11 +24,15 @@ abstract class AbstractIndexer extends \Magento\Indexer\Model\Resource\AbstractR * * @param \Magento\Framework\App\Resource $resource * @param \Magento\Eav\Model\Config $eavConfig + * @param string|null $resourcePrefix */ - public function __construct(\Magento\Framework\App\Resource $resource, \Magento\Eav\Model\Config $eavConfig) - { + public function __construct( + \Magento\Framework\App\Resource $resource, + \Magento\Eav\Model\Config $eavConfig, + $resourcePrefix = null + ) { $this->_eavConfig = $eavConfig; - parent::__construct($resource); + parent::__construct($resource, $resourcePrefix); } /** diff --git a/app/code/Magento/Catalog/Model/Resource/Product/Indexer/Eav/AbstractEav.php b/app/code/Magento/Catalog/Model/Resource/Product/Indexer/Eav/AbstractEav.php index 6b407d98eb19a..0fc82b1acbc7e 100644 --- a/app/code/Magento/Catalog/Model/Resource/Product/Indexer/Eav/AbstractEav.php +++ b/app/code/Magento/Catalog/Model/Resource/Product/Indexer/Eav/AbstractEav.php @@ -25,14 +25,16 @@ abstract class AbstractEav extends \Magento\Catalog\Model\Resource\Product\Index * @param \Magento\Framework\App\Resource $resource * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\Framework\Event\ManagerInterface $eventManager + * @param string|null $resourcePrefix */ public function __construct( \Magento\Framework\App\Resource $resource, \Magento\Eav\Model\Config $eavConfig, - \Magento\Framework\Event\ManagerInterface $eventManager + \Magento\Framework\Event\ManagerInterface $eventManager, + $resourcePrefix = null ) { $this->_eventManager = $eventManager; - parent::__construct($resource, $eavConfig); + parent::__construct($resource, $eavConfig, $resourcePrefix); } /** diff --git a/app/code/Magento/Catalog/Model/Resource/Product/Indexer/Eav/Source.php b/app/code/Magento/Catalog/Model/Resource/Product/Indexer/Eav/Source.php index a6ffee370583b..e5bb97afc817d 100644 --- a/app/code/Magento/Catalog/Model/Resource/Product/Indexer/Eav/Source.php +++ b/app/code/Magento/Catalog/Model/Resource/Product/Indexer/Eav/Source.php @@ -28,15 +28,17 @@ class Source extends AbstractEav * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Catalog\Model\Resource\Helper $resourceHelper + * @param string|null $resourcePrefix */ public function __construct( \Magento\Framework\App\Resource $resource, \Magento\Eav\Model\Config $eavConfig, \Magento\Framework\Event\ManagerInterface $eventManager, - \Magento\Catalog\Model\Resource\Helper $resourceHelper + \Magento\Catalog\Model\Resource\Helper $resourceHelper, + $resourcePrefix = null ) { $this->_resourceHelper = $resourceHelper; - parent::__construct($resource, $eavConfig, $eventManager); + parent::__construct($resource, $eavConfig, $eventManager, $resourcePrefix); } /** diff --git a/app/code/Magento/Catalog/Model/Resource/Product/Indexer/Price/DefaultPrice.php b/app/code/Magento/Catalog/Model/Resource/Product/Indexer/Price/DefaultPrice.php index 3e6cf3db6816f..e0c33c6433679 100644 --- a/app/code/Magento/Catalog/Model/Resource/Product/Indexer/Price/DefaultPrice.php +++ b/app/code/Magento/Catalog/Model/Resource/Product/Indexer/Price/DefaultPrice.php @@ -46,16 +46,18 @@ class DefaultPrice extends \Magento\Catalog\Model\Resource\Product\Indexer\Abstr * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Framework\Module\Manager $moduleManager + * @param string|null $resourcePrefix */ public function __construct( \Magento\Framework\App\Resource $resource, \Magento\Eav\Model\Config $eavConfig, \Magento\Framework\Event\ManagerInterface $eventManager, - \Magento\Framework\Module\Manager $moduleManager + \Magento\Framework\Module\Manager $moduleManager, + $resourcePrefix = null ) { $this->_eventManager = $eventManager; $this->moduleManager = $moduleManager; - parent::__construct($resource, $eavConfig); + parent::__construct($resource, $eavConfig, $resourcePrefix); } /** diff --git a/app/code/Magento/Catalog/Model/Resource/Product/Link.php b/app/code/Magento/Catalog/Model/Resource/Product/Link.php index be29863658c19..5cb5a34cc6f5a 100644 --- a/app/code/Magento/Catalog/Model/Resource/Product/Link.php +++ b/app/code/Magento/Catalog/Model/Resource/Product/Link.php @@ -29,11 +29,15 @@ class Link extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource * @param Relation $catalogProductRelation + * @param string|null $resourcePrefix */ - public function __construct(\Magento\Framework\App\Resource $resource, Relation $catalogProductRelation) - { + public function __construct( + \Magento\Framework\App\Resource $resource, + Relation $catalogProductRelation, + $resourcePrefix = null + ) { $this->_catalogProductRelation = $catalogProductRelation; - parent::__construct($resource); + parent::__construct($resource, $resourcePrefix); } /** diff --git a/app/code/Magento/Catalog/Model/Resource/Product/Option.php b/app/code/Magento/Catalog/Model/Resource/Product/Option.php index 9f619df100c98..952a2779b461f 100644 --- a/app/code/Magento/Catalog/Model/Resource/Product/Option.php +++ b/app/code/Magento/Catalog/Model/Resource/Product/Option.php @@ -40,17 +40,19 @@ class Option extends \Magento\Framework\Model\Resource\Db\AbstractDb * @param \Magento\Directory\Model\CurrencyFactory $currencyFactory * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Framework\App\Config\ScopeConfigInterface $config + * @param string|null $resourcePrefix */ public function __construct( \Magento\Framework\App\Resource $resource, \Magento\Directory\Model\CurrencyFactory $currencyFactory, \Magento\Store\Model\StoreManagerInterface $storeManager, - \Magento\Framework\App\Config\ScopeConfigInterface $config + \Magento\Framework\App\Config\ScopeConfigInterface $config, + $resourcePrefix = null ) { $this->_currencyFactory = $currencyFactory; $this->_storeManager = $storeManager; $this->_config = $config; - parent::__construct($resource); + parent::__construct($resource, $resourcePrefix); } /** diff --git a/app/code/Magento/Catalog/Model/Resource/Product/Option/Value.php b/app/code/Magento/Catalog/Model/Resource/Product/Option/Value.php index 8fda510c49d02..eceea6aa31b91 100644 --- a/app/code/Magento/Catalog/Model/Resource/Product/Option/Value.php +++ b/app/code/Magento/Catalog/Model/Resource/Product/Option/Value.php @@ -40,17 +40,19 @@ class Value extends \Magento\Framework\Model\Resource\Db\AbstractDb * @param \Magento\Directory\Model\CurrencyFactory $currencyFactory * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Framework\App\Config\ScopeConfigInterface $config + * @param string|null $resourcePrefix */ public function __construct( \Magento\Framework\App\Resource $resource, \Magento\Directory\Model\CurrencyFactory $currencyFactory, \Magento\Store\Model\StoreManagerInterface $storeManager, - \Magento\Framework\App\Config\ScopeConfigInterface $config + \Magento\Framework\App\Config\ScopeConfigInterface $config, + $resourcePrefix = null ) { $this->_currencyFactory = $currencyFactory; $this->_storeManager = $storeManager; $this->_config = $config; - parent::__construct($resource); + parent::__construct($resource, $resourcePrefix); } /** diff --git a/app/code/Magento/Catalog/Model/Resource/Product/Website.php b/app/code/Magento/Catalog/Model/Resource/Product/Website.php index 25c5a807fe892..b6aab24bf44d1 100644 --- a/app/code/Magento/Catalog/Model/Resource/Product/Website.php +++ b/app/code/Magento/Catalog/Model/Resource/Product/Website.php @@ -20,13 +20,15 @@ class Website extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource * @param \Magento\Store\Model\StoreManagerInterface $storeManager + * @param string|null $resourcePrefix */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Store\Model\StoreManagerInterface $storeManager + \Magento\Store\Model\StoreManagerInterface $storeManager, + $resourcePrefix = null ) { $this->_storeManager = $storeManager; - parent::__construct($resource); + parent::__construct($resource, $resourcePrefix); } /** diff --git a/app/code/Magento/Catalog/Model/Resource/Url.php b/app/code/Magento/Catalog/Model/Resource/Url.php index e8465ef90f37b..b2dc0de9f32ab 100644 --- a/app/code/Magento/Catalog/Model/Resource/Url.php +++ b/app/code/Magento/Catalog/Model/Resource/Url.php @@ -94,6 +94,7 @@ class Url extends \Magento\Framework\Model\Resource\Db\AbstractDb * @param Product $productResource * @param \Magento\Catalog\Model\Category $catalogCategory * @param \Psr\Log\LoggerInterface $logger + * @param string|null $resourcePrefix */ public function __construct( \Magento\Framework\App\Resource $resource, @@ -101,14 +102,15 @@ public function __construct( \Magento\Eav\Model\Config $eavConfig, Product $productResource, \Magento\Catalog\Model\Category $catalogCategory, - \Psr\Log\LoggerInterface $logger + \Psr\Log\LoggerInterface $logger, + $resourcePrefix = null ) { $this->_storeManager = $storeManager; $this->_eavConfig = $eavConfig; $this->productResource = $productResource; $this->_catalogCategory = $catalogCategory; $this->_logger = $logger; - parent::__construct($resource); + parent::__construct($resource, $resourcePrefix); } /** diff --git a/app/code/Magento/CatalogInventory/Model/Resource/Indexer/Stock/DefaultStock.php b/app/code/Magento/CatalogInventory/Model/Resource/Indexer/Stock/DefaultStock.php index a7396a044f43b..45506cd29c6d1 100644 --- a/app/code/Magento/CatalogInventory/Model/Resource/Indexer/Stock/DefaultStock.php +++ b/app/code/Magento/CatalogInventory/Model/Resource/Indexer/Stock/DefaultStock.php @@ -38,14 +38,16 @@ class DefaultStock extends \Magento\Catalog\Model\Resource\Product\Indexer\Abstr * @param \Magento\Framework\App\Resource $resource * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig + * @param string|null $resourcePrefix */ public function __construct( \Magento\Framework\App\Resource $resource, \Magento\Eav\Model\Config $eavConfig, - \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig + \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, + $resourcePrefix = null ) { $this->_scopeConfig = $scopeConfig; - parent::__construct($resource, $eavConfig); + parent::__construct($resource, $eavConfig, $resourcePrefix); } /** diff --git a/app/code/Magento/CatalogInventory/Model/Resource/Stock.php b/app/code/Magento/CatalogInventory/Model/Resource/Stock.php index 42c162eb4f8ed..65dca507dbefe 100644 --- a/app/code/Magento/CatalogInventory/Model/Resource/Stock.php +++ b/app/code/Magento/CatalogInventory/Model/Resource/Stock.php @@ -84,15 +84,17 @@ class Stock extends \Magento\Framework\Model\Resource\Db\AbstractDb * @param \Magento\Framework\Stdlib\DateTime $dateTime * @param StockConfigurationInterface $stockConfiguration * @param StoreManagerInterface $storeManager + * @param string|null $resourcePrefix */ public function __construct( \Magento\Framework\App\Resource $resource, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Framework\Stdlib\DateTime $dateTime, StockConfigurationInterface $stockConfiguration, - StoreManagerInterface $storeManager + StoreManagerInterface $storeManager, + $resourcePrefix = null ) { - parent::__construct($resource); + parent::__construct($resource, $resourcePrefix); $this->_scopeConfig = $scopeConfig; $this->dateTime = $dateTime; $this->stockConfiguration = $stockConfiguration; diff --git a/app/code/Magento/CatalogInventory/Model/Resource/Stock/Item.php b/app/code/Magento/CatalogInventory/Model/Resource/Stock/Item.php index d288b95a6eae7..b8e0e99e873b8 100644 --- a/app/code/Magento/CatalogInventory/Model/Resource/Stock/Item.php +++ b/app/code/Magento/CatalogInventory/Model/Resource/Stock/Item.php @@ -30,13 +30,15 @@ class Item extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param AppResource $resource * @param Processor $processor + * @param string|null $resourcePrefix */ public function __construct( AppResource $resource, - Processor $processor + Processor $processor, + $resourcePrefix = null ) { $this->stockIndexerProcessor = $processor; - parent::__construct($resource); + parent::__construct($resource, $resourcePrefix); } /** diff --git a/app/code/Magento/CatalogInventory/Model/Resource/Stock/Status.php b/app/code/Magento/CatalogInventory/Model/Resource/Stock/Status.php index 4b971fecf3131..71fca1feb21cf 100644 --- a/app/code/Magento/CatalogInventory/Model/Resource/Stock/Status.php +++ b/app/code/Magento/CatalogInventory/Model/Resource/Stock/Status.php @@ -36,14 +36,16 @@ class Status extends \Magento\Framework\Model\Resource\Db\AbstractDb * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Store\Model\WebsiteFactory $websiteFactory * @param \Magento\Eav\Model\Config $eavConfig + * @param string|null $resourcePrefix */ public function __construct( \Magento\Framework\App\Resource $resource, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Store\Model\WebsiteFactory $websiteFactory, - \Magento\Eav\Model\Config $eavConfig + \Magento\Eav\Model\Config $eavConfig, + $resourcePrefix = null ) { - parent::__construct($resource); + parent::__construct($resource, $resourcePrefix); $this->_storeManager = $storeManager; $this->_websiteFactory = $websiteFactory; diff --git a/app/code/Magento/CatalogRule/Model/Resource/Rule.php b/app/code/Magento/CatalogRule/Model/Resource/Rule.php index e3b9617bdfe4a..01844211d28cb 100644 --- a/app/code/Magento/CatalogRule/Model/Resource/Rule.php +++ b/app/code/Magento/CatalogRule/Model/Resource/Rule.php @@ -100,6 +100,7 @@ class Rule extends \Magento\Rule\Model\Resource\AbstractResource * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Stdlib\DateTime $dateTime * @param PriceCurrencyInterface $priceCurrency + * @param string|null $resourcePrefix */ public function __construct( \Magento\Framework\App\Resource $resource, @@ -111,7 +112,8 @@ public function __construct( \Magento\CatalogRule\Helper\Data $catalogRuleData, \Psr\Log\LoggerInterface $logger, \Magento\Framework\Stdlib\DateTime $dateTime, - PriceCurrencyInterface $priceCurrency + PriceCurrencyInterface $priceCurrency, + $resourcePrefix = null ) { $this->_storeManager = $storeManager; $this->_conditionFactory = $conditionFactory; @@ -122,7 +124,7 @@ public function __construct( $this->_logger = $logger; $this->dateTime = $dateTime; $this->priceCurrency = $priceCurrency; - parent::__construct($resource); + parent::__construct($resource, $resourcePrefix); } /** diff --git a/app/code/Magento/CatalogSearch/Model/Resource/Advanced.php b/app/code/Magento/CatalogSearch/Model/Resource/Advanced.php index bd841d931afe2..a2cfcf517baf3 100644 --- a/app/code/Magento/CatalogSearch/Model/Resource/Advanced.php +++ b/app/code/Magento/CatalogSearch/Model/Resource/Advanced.php @@ -32,15 +32,17 @@ class Advanced extends \Magento\Framework\Model\Resource\Db\AbstractDb * @param \Magento\Framework\App\Resource $resource * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Framework\Event\ManagerInterface $eventManager + * @param string|null $resourcePrefix */ public function __construct( \Magento\Framework\App\Resource $resource, \Magento\Store\Model\StoreManagerInterface $storeManager, - \Magento\Framework\Event\ManagerInterface $eventManager + \Magento\Framework\Event\ManagerInterface $eventManager, + $resourcePrefix = null ) { $this->_storeManager = $storeManager; $this->_eventManager = $eventManager; - parent::__construct($resource); + parent::__construct($resource, $resourcePrefix); } /** diff --git a/app/code/Magento/CatalogSearch/Model/Resource/Engine.php b/app/code/Magento/CatalogSearch/Model/Resource/Engine.php index bdec803df3d4d..c916869ba874d 100644 --- a/app/code/Magento/CatalogSearch/Model/Resource/Engine.php +++ b/app/code/Magento/CatalogSearch/Model/Resource/Engine.php @@ -72,6 +72,7 @@ class Engine extends AbstractDb implements EngineInterface * @param \Magento\CatalogSearch\Model\Resource\Advanced\Collection $searchResourceCollection * @param \Magento\CatalogSearch\Helper\Data $catalogSearchData * @param \Magento\Search\Model\Resource\Helper $resourceHelper + * @param string|null $resourcePrefix */ public function __construct( \Magento\Framework\App\Resource $resource, @@ -80,7 +81,8 @@ public function __construct( \Magento\CatalogSearch\Model\Resource\Advanced $searchResource, \Magento\CatalogSearch\Model\Resource\Advanced\Collection $searchResourceCollection, \Magento\CatalogSearch\Helper\Data $catalogSearchData, - \Magento\Search\Model\Resource\Helper $resourceHelper + \Magento\Search\Model\Resource\Helper $resourceHelper, + $resourcePrefix = null ) { $this->productCollectionFactory = $productCollectionFactory; $this->_catalogProductVisibility = $catalogProductVisibility; @@ -88,7 +90,7 @@ public function __construct( $this->_searchResourceCollection = $searchResourceCollection; $this->_catalogSearchData = $catalogSearchData; $this->_resourceHelper = $resourceHelper; - parent::__construct($resource); + parent::__construct($resource, $resourcePrefix); } /** diff --git a/app/code/Magento/CatalogSearch/Model/Resource/Fulltext.php b/app/code/Magento/CatalogSearch/Model/Resource/Fulltext.php index 1f47cdd3e7a60..8dd28a16dd39b 100644 --- a/app/code/Magento/CatalogSearch/Model/Resource/Fulltext.php +++ b/app/code/Magento/CatalogSearch/Model/Resource/Fulltext.php @@ -38,17 +38,19 @@ class Fulltext extends \Magento\Framework\Model\Resource\Db\AbstractDb * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Framework\Filter\FilterManager $filter * @param Helper $resourceHelper + * @param string|null $resourcePrefix */ public function __construct( \Magento\Framework\App\Resource $resource, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Framework\Filter\FilterManager $filter, - \Magento\Search\Model\Resource\Helper $resourceHelper + \Magento\Search\Model\Resource\Helper $resourceHelper, + $resourcePrefix = null ) { $this->_eventManager = $eventManager; $this->filter = $filter; $this->_resourceHelper = $resourceHelper; - parent::__construct($resource); + parent::__construct($resource, $resourcePrefix); } /** diff --git a/app/code/Magento/CheckoutAgreements/Model/Resource/Agreement.php b/app/code/Magento/CheckoutAgreements/Model/Resource/Agreement.php index 5b28e26a142f8..fcab8d73a90e2 100644 --- a/app/code/Magento/CheckoutAgreements/Model/Resource/Agreement.php +++ b/app/code/Magento/CheckoutAgreements/Model/Resource/Agreement.php @@ -18,11 +18,15 @@ class Agreement extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource * @param \Magento\Framework\Filter\FilterManager $filterManager + * @param string|null $resourcePrefix */ - public function __construct(\Magento\Framework\App\Resource $resource, \Magento\Framework\Filter\FilterManager $filterManager) - { + public function __construct( + \Magento\Framework\App\Resource $resource, + \Magento\Framework\Filter\FilterManager $filterManager, + $resourcePrefix = null + ) { $this->filterManager = $filterManager; - parent::__construct($resource); + parent::__construct($resource, $resourcePrefix); } /** diff --git a/app/code/Magento/Cms/Model/Resource/Block.php b/app/code/Magento/Cms/Model/Resource/Block.php index 9c554253d2940..158ed57725707 100644 --- a/app/code/Magento/Cms/Model/Resource/Block.php +++ b/app/code/Magento/Cms/Model/Resource/Block.php @@ -28,13 +28,15 @@ class Block extends \Magento\Framework\Model\Resource\Db\AbstractDb * @param \Magento\Framework\App\Resource $resource * @param \Magento\Framework\Stdlib\DateTime\DateTime $date * @param \Magento\Store\Model\StoreManagerInterface $storeManager + * @param string|null $resourcePrefix */ public function __construct( \Magento\Framework\App\Resource $resource, \Magento\Framework\Stdlib\DateTime\DateTime $date, - \Magento\Store\Model\StoreManagerInterface $storeManager + \Magento\Store\Model\StoreManagerInterface $storeManager, + $resourcePrefix = null ) { - parent::__construct($resource); + parent::__construct($resource, $resourcePrefix); $this->_storeManager = $storeManager; $this->_date = $date; } diff --git a/app/code/Magento/Cms/Model/Resource/Page.php b/app/code/Magento/Cms/Model/Resource/Page.php index d45a2001f65af..3aec982b2e6ec 100644 --- a/app/code/Magento/Cms/Model/Resource/Page.php +++ b/app/code/Magento/Cms/Model/Resource/Page.php @@ -41,14 +41,16 @@ class Page extends \Magento\Framework\Model\Resource\Db\AbstractDb * @param \Magento\Framework\Stdlib\DateTime\DateTime $date * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Framework\Stdlib\DateTime $dateTime + * @param string|null $resourcePrefix */ public function __construct( \Magento\Framework\App\Resource $resource, \Magento\Framework\Stdlib\DateTime\DateTime $date, \Magento\Store\Model\StoreManagerInterface $storeManager, - \Magento\Framework\Stdlib\DateTime $dateTime + \Magento\Framework\Stdlib\DateTime $dateTime, + $resourcePrefix = null ) { - parent::__construct($resource); + parent::__construct($resource, $resourcePrefix); $this->_date = $date; $this->_storeManager = $storeManager; $this->dateTime = $dateTime; diff --git a/app/code/Magento/ConfigurableProduct/Model/Resource/Product/Type/Configurable.php b/app/code/Magento/ConfigurableProduct/Model/Resource/Product/Type/Configurable.php index aba00204d0fe1..fab4e77126f58 100644 --- a/app/code/Magento/ConfigurableProduct/Model/Resource/Product/Type/Configurable.php +++ b/app/code/Magento/ConfigurableProduct/Model/Resource/Product/Type/Configurable.php @@ -19,13 +19,15 @@ class Configurable extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource * @param \Magento\Catalog\Model\Resource\Product\Relation $catalogProductRelation + * @param string|null $resourcePrefix */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Catalog\Model\Resource\Product\Relation $catalogProductRelation + \Magento\Catalog\Model\Resource\Product\Relation $catalogProductRelation, + $resourcePrefix = null ) { $this->_catalogProductRelation = $catalogProductRelation; - parent::__construct($resource); + parent::__construct($resource, $resourcePrefix); } /** diff --git a/app/code/Magento/ConfigurableProduct/Model/Resource/Product/Type/Configurable/Attribute.php b/app/code/Magento/ConfigurableProduct/Model/Resource/Product/Type/Configurable/Attribute.php index 7361db789933d..8d3aaf241e234 100644 --- a/app/code/Magento/ConfigurableProduct/Model/Resource/Product/Type/Configurable/Attribute.php +++ b/app/code/Magento/ConfigurableProduct/Model/Resource/Product/Type/Configurable/Attribute.php @@ -43,15 +43,17 @@ class Attribute extends \Magento\Framework\Model\Resource\Db\AbstractDb * @param \Magento\Framework\App\Resource $resource * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Helper\Data $catalogData + * @param string|null $resourcePrefix */ public function __construct( \Magento\Framework\App\Resource $resource, \Magento\Store\Model\StoreManagerInterface $storeManager, - \Magento\Catalog\Helper\Data $catalogData + \Magento\Catalog\Helper\Data $catalogData, + $resourcePrefix = null ) { $this->_storeManager = $storeManager; $this->_catalogData = $catalogData; - parent::__construct($resource); + parent::__construct($resource, $resourcePrefix); } /** diff --git a/app/code/Magento/Core/Model/Resource/Design.php b/app/code/Magento/Core/Model/Resource/Design.php index df4bff17d80ce..6c7aeec8b1120 100644 --- a/app/code/Magento/Core/Model/Resource/Design.php +++ b/app/code/Magento/Core/Model/Resource/Design.php @@ -22,11 +22,15 @@ class Design extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource * @param DateTime $dateTime + * @param string|null $resourcePrefix */ - public function __construct(\Magento\Framework\App\Resource $resource, DateTime $dateTime) - { + public function __construct( + \Magento\Framework\App\Resource $resource, + DateTime $dateTime, + $resourcePrefix = null + ) { $this->dateTime = $dateTime; - parent::__construct($resource); + parent::__construct($resource, $resourcePrefix); } /** diff --git a/app/code/Magento/Core/Model/Resource/File/Storage/Database.php b/app/code/Magento/Core/Model/Resource/File/Storage/Database.php index ac9cb6e3450eb..2fbe6b798e2c1 100644 --- a/app/code/Magento/Core/Model/Resource/File/Storage/Database.php +++ b/app/code/Magento/Core/Model/Resource/File/Storage/Database.php @@ -18,10 +18,14 @@ class Database extends \Magento\Core\Model\Resource\File\Storage\AbstractStorage /** * @param \Magento\Framework\App\Resource $resource * @param \Magento\Framework\DB\Helper $resourceHelper + * @param string|null $resourcePrefix */ - public function __construct(\Magento\Framework\App\Resource $resource, \Magento\Framework\DB\Helper $resourceHelper) - { - parent::__construct($resource); + public function __construct( + \Magento\Framework\App\Resource $resource, + \Magento\Framework\DB\Helper $resourceHelper, + $resourcePrefix = null + ) { + parent::__construct($resource, $resourcePrefix); $this->_resourceHelper = $resourceHelper; } diff --git a/app/code/Magento/Core/Model/Resource/Layout/Update.php b/app/code/Magento/Core/Model/Resource/Layout/Update.php index d6dd5b7e001dc..677ed2734392e 100644 --- a/app/code/Magento/Core/Model/Resource/Layout/Update.php +++ b/app/code/Magento/Core/Model/Resource/Layout/Update.php @@ -18,10 +18,14 @@ class Update extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource * @param \Magento\Framework\Cache\FrontendInterface $cache + * @param string|null $resourcePrefix */ - public function __construct(\Magento\Framework\App\Resource $resource, \Magento\Framework\Cache\FrontendInterface $cache) - { - parent::__construct($resource); + public function __construct( + \Magento\Framework\App\Resource $resource, + \Magento\Framework\Cache\FrontendInterface $cache, + $resourcePrefix = null + ) { + parent::__construct($resource, $resourcePrefix); $this->_cache = $cache; } diff --git a/app/code/Magento/Customer/Model/Resource/Group.php b/app/code/Magento/Customer/Model/Resource/Group.php index 53adec297113b..3a63fe0dda4b9 100644 --- a/app/code/Magento/Customer/Model/Resource/Group.php +++ b/app/code/Magento/Customer/Model/Resource/Group.php @@ -28,15 +28,17 @@ class Group extends \Magento\Framework\Model\Resource\Db\AbstractDb * @param \Magento\Framework\App\Resource $resource * @param \Magento\Customer\Api\GroupManagementInterface $groupManagement * @param Customer\CollectionFactory $customersFactory + * @param string|null $resourcePrefix */ public function __construct( \Magento\Framework\App\Resource $resource, \Magento\Customer\Api\GroupManagementInterface $groupManagement, - \Magento\Customer\Model\Resource\Customer\CollectionFactory $customersFactory + \Magento\Customer\Model\Resource\Customer\CollectionFactory $customersFactory, + $resourcePrefix = null ) { $this->_groupManagement = $groupManagement; $this->_customersFactory = $customersFactory; - parent::__construct($resource); + parent::__construct($resource, $resourcePrefix); } /** diff --git a/app/code/Magento/Customer/Model/Resource/Visitor.php b/app/code/Magento/Customer/Model/Resource/Visitor.php index db568a76dbe9e..e63720d186d91 100644 --- a/app/code/Magento/Customer/Model/Resource/Visitor.php +++ b/app/code/Magento/Customer/Model/Resource/Visitor.php @@ -26,15 +26,17 @@ class Visitor extends \Magento\Framework\Model\Resource\Db\AbstractDb * @param \Magento\Framework\App\Resource $resource * @param \Magento\Framework\Stdlib\DateTime\DateTime $date * @param \Magento\Framework\Stdlib\DateTime $dateTime + * @param string|null $resourcePrefix */ public function __construct( \Magento\Framework\App\Resource $resource, \Magento\Framework\Stdlib\DateTime\DateTime $date, - \Magento\Framework\Stdlib\DateTime $dateTime + \Magento\Framework\Stdlib\DateTime $dateTime, + $resourcePrefix = null ) { $this->date = $date; $this->dateTime = $dateTime; - parent::__construct($resource); + parent::__construct($resource, $resourcePrefix); } /** diff --git a/app/code/Magento/CustomerImportExport/Model/Resource/Import/CustomerComposite/Data.php b/app/code/Magento/CustomerImportExport/Model/Resource/Import/CustomerComposite/Data.php index 422c51e343518..5310383b942f0 100644 --- a/app/code/Magento/CustomerImportExport/Model/Resource/Import/CustomerComposite/Data.php +++ b/app/code/Magento/CustomerImportExport/Model/Resource/Import/CustomerComposite/Data.php @@ -28,14 +28,16 @@ class Data extends \Magento\ImportExport\Model\Resource\Import\Data * * @param \Magento\Framework\App\Resource $resource * @param \Magento\Core\Helper\Data $coreHelper + * @param string|null $resourcePrefix * @param array $arguments */ public function __construct( \Magento\Framework\App\Resource $resource, \Magento\Core\Helper\Data $coreHelper, + $resourcePrefix = null, array $arguments = [] ) { - parent::__construct($resource, $coreHelper, $arguments); + parent::__construct($resource, $coreHelper, $arguments, $resourcePrefix); if (isset($arguments['entity_type'])) { $this->_entityType = $arguments['entity_type']; diff --git a/app/code/Magento/DesignEditor/Model/Theme/Resource/Change.php b/app/code/Magento/DesignEditor/Model/Theme/Resource/Change.php index fdec8c5f8345a..a7f4fc398bd69 100644 --- a/app/code/Magento/DesignEditor/Model/Theme/Resource/Change.php +++ b/app/code/Magento/DesignEditor/Model/Theme/Resource/Change.php @@ -18,12 +18,15 @@ class Change extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource * @param \Magento\Framework\Stdlib\DateTime $dateTime - * @return void + * @param string|null $resourcePrefix */ - public function __construct(\Magento\Framework\App\Resource $resource, \Magento\Framework\Stdlib\DateTime $dateTime) - { + public function __construct( + \Magento\Framework\App\Resource $resource, + \Magento\Framework\Stdlib\DateTime $dateTime, + $resourcePrefix = null + ) { $this->dateTime = $dateTime; - parent::__construct($resource); + parent::__construct($resource, $resourcePrefix); } /** diff --git a/app/code/Magento/Directory/Model/Resource/Region.php b/app/code/Magento/Directory/Model/Resource/Region.php index 9346c0cc49aea..297e9e76fa1e0 100644 --- a/app/code/Magento/Directory/Model/Resource/Region.php +++ b/app/code/Magento/Directory/Model/Resource/Region.php @@ -26,10 +26,14 @@ class Region extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource * @param \Magento\Framework\Locale\ResolverInterface $localeResolver + * @param string|null $resourcePrefix */ - public function __construct(\Magento\Framework\App\Resource $resource, \Magento\Framework\Locale\ResolverInterface $localeResolver) - { - parent::__construct($resource); + public function __construct( + \Magento\Framework\App\Resource $resource, + \Magento\Framework\Locale\ResolverInterface $localeResolver, + $resourcePrefix = null + ) { + parent::__construct($resource, $resourcePrefix); $this->_localeResolver = $localeResolver; } diff --git a/app/code/Magento/Downloadable/Model/Resource/Link.php b/app/code/Magento/Downloadable/Model/Resource/Link.php index a8551127a09ea..579d60f8e1e8d 100644 --- a/app/code/Magento/Downloadable/Model/Resource/Link.php +++ b/app/code/Magento/Downloadable/Model/Resource/Link.php @@ -40,19 +40,21 @@ class Link extends \Magento\Framework\Model\Resource\Db\AbstractDb * @param \Magento\Framework\App\Config\ScopeConfigInterface $configuration * @param \Magento\Directory\Model\CurrencyFactory $currencyFactory * @param \Magento\Store\Model\StoreManagerInterface $storeManager + * @param string|null $resourcePrefix */ public function __construct( \Magento\Framework\App\Resource $resource, \Magento\Catalog\Helper\Data $catalogData, \Magento\Framework\App\Config\ScopeConfigInterface $configuration, \Magento\Directory\Model\CurrencyFactory $currencyFactory, - \Magento\Store\Model\StoreManagerInterface $storeManager + \Magento\Store\Model\StoreManagerInterface $storeManager, + $resourcePrefix = null ) { $this->_catalogData = $catalogData; $this->_configuration = $configuration; $this->_currencyFactory = $currencyFactory; $this->_storeManager = $storeManager; - parent::__construct($resource); + parent::__construct($resource, $resourcePrefix); } /** diff --git a/app/code/Magento/Eav/Model/Resource/Entity/Attribute.php b/app/code/Magento/Eav/Model/Resource/Entity/Attribute.php index 2b9ea59ec2b47..8a258e9c7bee5 100644 --- a/app/code/Magento/Eav/Model/Resource/Entity/Attribute.php +++ b/app/code/Magento/Eav/Model/Resource/Entity/Attribute.php @@ -40,15 +40,17 @@ class Attribute extends \Magento\Framework\Model\Resource\Db\AbstractDb * @param \Magento\Framework\App\Resource $resource * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param Type $eavEntityType + * @param string|null $resourcePrefix */ public function __construct( \Magento\Framework\App\Resource $resource, \Magento\Store\Model\StoreManagerInterface $storeManager, - Type $eavEntityType + Type $eavEntityType, + $resourcePrefix = null ) { $this->_storeManager = $storeManager; $this->_eavEntityType = $eavEntityType; - parent::__construct($resource); + parent::__construct($resource, $resourcePrefix); } /** diff --git a/app/code/Magento/Eav/Model/Resource/Entity/Attribute/Set.php b/app/code/Magento/Eav/Model/Resource/Entity/Attribute/Set.php index 75dccf2a52dcc..7fa47de900fb5 100644 --- a/app/code/Magento/Eav/Model/Resource/Entity/Attribute/Set.php +++ b/app/code/Magento/Eav/Model/Resource/Entity/Attribute/Set.php @@ -26,13 +26,15 @@ class Set extends \Magento\Framework\Model\Resource\Db\AbstractDb * @param \Magento\Framework\App\Resource $resource * @param GroupFactory $attrGroupFactory * @param \Magento\Eav\Model\Config $eavConfig + * @param string|null $resourcePrefix */ public function __construct( \Magento\Framework\App\Resource $resource, \Magento\Eav\Model\Resource\Entity\Attribute\GroupFactory $attrGroupFactory, - \Magento\Eav\Model\Config $eavConfig + \Magento\Eav\Model\Config $eavConfig, + $resourcePrefix = null ) { - parent::__construct($resource); + parent::__construct($resource, $resourcePrefix); $this->_attrGroupFactory = $attrGroupFactory; $this->eavConfig = $eavConfig; } diff --git a/app/code/Magento/Email/Model/Resource/Template.php b/app/code/Magento/Email/Model/Resource/Template.php index fdff9c6aced1f..e16fcf8670b3a 100644 --- a/app/code/Magento/Email/Model/Resource/Template.php +++ b/app/code/Magento/Email/Model/Resource/Template.php @@ -22,11 +22,15 @@ class Template extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource * @param \Magento\Framework\Stdlib\DateTime $dateTime + * @param string|null $resourcePrefix */ - public function __construct(\Magento\Framework\App\Resource $resource, \Magento\Framework\Stdlib\DateTime $dateTime) - { + public function __construct( + \Magento\Framework\App\Resource $resource, + \Magento\Framework\Stdlib\DateTime $dateTime, + $resourcePrefix = null + ) { $this->dateTime = $dateTime; - parent::__construct($resource); + parent::__construct($resource, $resourcePrefix); } /** diff --git a/app/code/Magento/ImportExport/Model/Resource/Import/Data.php b/app/code/Magento/ImportExport/Model/Resource/Import/Data.php index d05f45a540593..8843c0d871f9e 100644 --- a/app/code/Magento/ImportExport/Model/Resource/Import/Data.php +++ b/app/code/Magento/ImportExport/Model/Resource/Import/Data.php @@ -29,14 +29,16 @@ class Data extends \Magento\Framework\Model\Resource\Db\AbstractDb implements \I * * @param \Magento\Framework\App\Resource $resource * @param \Magento\Core\Helper\Data $coreHelper + * @param string|null $resourcePrefix * @param array $arguments */ public function __construct( \Magento\Framework\App\Resource $resource, \Magento\Core\Helper\Data $coreHelper, + $resourcePrefix = null, array $arguments = [] ) { - parent::__construct($resource); + parent::__construct($resource, $resourcePrefix); $this->_jsonHelper = $coreHelper; } diff --git a/app/code/Magento/Integration/Model/Resource/Oauth/Consumer.php b/app/code/Magento/Integration/Model/Resource/Oauth/Consumer.php index 9dbf856debf74..bf5f6079056c8 100644 --- a/app/code/Magento/Integration/Model/Resource/Oauth/Consumer.php +++ b/app/code/Magento/Integration/Model/Resource/Oauth/Consumer.php @@ -15,11 +15,15 @@ class Consumer extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource * @param \Magento\Framework\Stdlib\DateTime $dateTime + * @param string|null $resourcePrefix */ - public function __construct(\Magento\Framework\App\Resource $resource, \Magento\Framework\Stdlib\DateTime $dateTime) - { + public function __construct( + \Magento\Framework\App\Resource $resource, + \Magento\Framework\Stdlib\DateTime $dateTime, + $resourcePrefix = null + ) { $this->_dateTime = $dateTime; - parent::__construct($resource); + parent::__construct($resource, $resourcePrefix); } /** diff --git a/app/code/Magento/Integration/Model/Resource/Oauth/Token.php b/app/code/Magento/Integration/Model/Resource/Oauth/Token.php index 150986cf772ce..1ebf7c3991468 100644 --- a/app/code/Magento/Integration/Model/Resource/Oauth/Token.php +++ b/app/code/Magento/Integration/Model/Resource/Oauth/Token.php @@ -20,11 +20,15 @@ class Token extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource * @param \Magento\Framework\Stdlib\DateTime $dateTime + * @param string|null $resourcePrefix */ - public function __construct(\Magento\Framework\App\Resource $resource, \Magento\Framework\Stdlib\DateTime $dateTime) - { + public function __construct( + \Magento\Framework\App\Resource $resource, + \Magento\Framework\Stdlib\DateTime $dateTime, + $resourcePrefix = null + ) { $this->_dateTime = $dateTime; - parent::__construct($resource); + parent::__construct($resource, $resourcePrefix); } /** diff --git a/app/code/Magento/Log/Model/Resource/Log.php b/app/code/Magento/Log/Model/Resource/Log.php index 72e43569fc8d3..03d0aef919002 100644 --- a/app/code/Magento/Log/Model/Resource/Log.php +++ b/app/code/Magento/Log/Model/Resource/Log.php @@ -34,17 +34,19 @@ class Log extends \Magento\Framework\Model\Resource\Db\AbstractDb * @param \Magento\Framework\Stdlib\DateTime\DateTime $date * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Framework\Stdlib\DateTime $dateTime + * @param string|null $resourcePrefix */ public function __construct( \Magento\Framework\App\Resource $resource, \Magento\Framework\Stdlib\DateTime\DateTime $date, \Magento\Framework\Event\ManagerInterface $eventManager, - \Magento\Framework\Stdlib\DateTime $dateTime + \Magento\Framework\Stdlib\DateTime $dateTime, + $resourcePrefix = null ) { $this->_date = $date; $this->_eventManager = $eventManager; $this->dateTime = $dateTime; - parent::__construct($resource); + parent::__construct($resource, $resourcePrefix); } /** diff --git a/app/code/Magento/Log/Model/Resource/Visitor.php b/app/code/Magento/Log/Model/Resource/Visitor.php index c11527b8462a7..2cc28e05b1fb2 100644 --- a/app/code/Magento/Log/Model/Resource/Visitor.php +++ b/app/code/Magento/Log/Model/Resource/Visitor.php @@ -39,17 +39,19 @@ class Visitor extends \Magento\Framework\Model\Resource\Db\AbstractDb * @param \Magento\Framework\Stdlib\DateTime\DateTime $date * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Framework\Stdlib\String $string + * @param string|null $resourcePrefix */ public function __construct( \Magento\Framework\App\Resource $resource, \Magento\Framework\Stdlib\DateTime\DateTime $date, \Magento\Store\Model\StoreManagerInterface $storeManager, - \Magento\Framework\Stdlib\String $string + \Magento\Framework\Stdlib\String $string, + $resourcePrefix = null ) { $this->_date = $date; $this->_storeManager = $storeManager; $this->string = $string; - parent::__construct($resource); + parent::__construct($resource, $resourcePrefix); } /** diff --git a/app/code/Magento/Log/Model/Resource/Visitor/Online.php b/app/code/Magento/Log/Model/Resource/Visitor/Online.php index 69060784d35c3..b73b215206d72 100644 --- a/app/code/Magento/Log/Model/Resource/Visitor/Online.php +++ b/app/code/Magento/Log/Model/Resource/Visitor/Online.php @@ -20,11 +20,15 @@ class Online extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource * @param \Magento\Framework\Stdlib\DateTime\DateTime $date + * @param string|null $resourcePrefix */ - public function __construct(\Magento\Framework\App\Resource $resource, \Magento\Framework\Stdlib\DateTime\DateTime $date) - { + public function __construct( + \Magento\Framework\App\Resource $resource, + \Magento\Framework\Stdlib\DateTime\DateTime $date, + $resourcePrefix = null + ) { $this->_date = $date; - parent::__construct($resource); + parent::__construct($resource, $resourcePrefix); } /** diff --git a/app/code/Magento/Newsletter/Model/Resource/Queue.php b/app/code/Magento/Newsletter/Model/Resource/Queue.php index 6da543c452be2..09aec95d885fa 100644 --- a/app/code/Magento/Newsletter/Model/Resource/Queue.php +++ b/app/code/Magento/Newsletter/Model/Resource/Queue.php @@ -27,12 +27,14 @@ class Queue extends \Magento\Framework\Model\Resource\Db\AbstractDb * * @param \Magento\Framework\App\Resource $resource * @param \Magento\Newsletter\Model\Resource\Subscriber\Collection $subscriberCollection + * @param string|null $resourcePrefix */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Newsletter\Model\Resource\Subscriber\Collection $subscriberCollection + \Magento\Newsletter\Model\Resource\Subscriber\Collection $subscriberCollection, + $resourcePrefix = null ) { - parent::__construct($resource); + parent::__construct($resource, $resourcePrefix); $this->_subscriberCollection = $subscriberCollection; } diff --git a/app/code/Magento/Newsletter/Model/Resource/Subscriber.php b/app/code/Magento/Newsletter/Model/Resource/Subscriber.php index 6c5711e2e04ab..e4cfbe2094cb8 100644 --- a/app/code/Magento/Newsletter/Model/Resource/Subscriber.php +++ b/app/code/Magento/Newsletter/Model/Resource/Subscriber.php @@ -58,15 +58,17 @@ class Subscriber extends \Magento\Framework\Model\Resource\Db\AbstractDb * @param \Magento\Framework\App\Resource $resource * @param \Magento\Framework\Stdlib\DateTime\DateTime $date * @param \Magento\Framework\Math\Random $mathRandom + * @param string|null $resourcePrefix */ public function __construct( \Magento\Framework\App\Resource $resource, \Magento\Framework\Stdlib\DateTime\DateTime $date, - \Magento\Framework\Math\Random $mathRandom + \Magento\Framework\Math\Random $mathRandom, + $resourcePrefix = null ) { $this->_date = $date; $this->mathRandom = $mathRandom; - parent::__construct($resource); + parent::__construct($resource, $resourcePrefix); } /** diff --git a/app/code/Magento/Newsletter/Model/Resource/Template.php b/app/code/Magento/Newsletter/Model/Resource/Template.php index 9fea41a144014..fa1b0ca555ef7 100644 --- a/app/code/Magento/Newsletter/Model/Resource/Template.php +++ b/app/code/Magento/Newsletter/Model/Resource/Template.php @@ -22,10 +22,14 @@ class Template extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource * @param \Magento\Framework\Stdlib\DateTime\DateTime $date + * @param string|null $resourcePrefix */ - public function __construct(\Magento\Framework\App\Resource $resource, \Magento\Framework\Stdlib\DateTime\DateTime $date) - { - parent::__construct($resource); + public function __construct( + \Magento\Framework\App\Resource $resource, + \Magento\Framework\Stdlib\DateTime\DateTime $date, + $resourcePrefix = null + ) { + parent::__construct($resource, $resourcePrefix); $this->_date = $date; } diff --git a/app/code/Magento/OfflineShipping/Model/Resource/Carrier/Tablerate.php b/app/code/Magento/OfflineShipping/Model/Resource/Carrier/Tablerate.php index 71115790441ed..8130cc0f185b7 100644 --- a/app/code/Magento/OfflineShipping/Model/Resource/Carrier/Tablerate.php +++ b/app/code/Magento/OfflineShipping/Model/Resource/Carrier/Tablerate.php @@ -126,6 +126,7 @@ class Tablerate extends \Magento\Framework\Model\Resource\Db\AbstractDb * @param \Magento\Directory\Model\Resource\Country\CollectionFactory $countryCollectionFactory * @param \Magento\Directory\Model\Resource\Region\CollectionFactory $regionCollectionFactory * @param \Magento\Framework\Filesystem $filesystem + * @param string|null $resourcePrefix */ public function __construct( \Magento\Framework\App\Resource $resource, @@ -135,9 +136,10 @@ public function __construct( \Magento\OfflineShipping\Model\Carrier\Tablerate $carrierTablerate, \Magento\Directory\Model\Resource\Country\CollectionFactory $countryCollectionFactory, \Magento\Directory\Model\Resource\Region\CollectionFactory $regionCollectionFactory, - \Magento\Framework\Filesystem $filesystem + \Magento\Framework\Filesystem $filesystem, + $resourcePrefix = null ) { - parent::__construct($resource); + parent::__construct($resource, $resourcePrefix); $this->_coreConfig = $coreConfig; $this->_logger = $logger; $this->_storeManager = $storeManager; diff --git a/app/code/Magento/Persistent/Model/Resource/Session.php b/app/code/Magento/Persistent/Model/Resource/Session.php index 8846d52e3e048..5402d967c54bb 100644 --- a/app/code/Magento/Persistent/Model/Resource/Session.php +++ b/app/code/Magento/Persistent/Model/Resource/Session.php @@ -29,13 +29,15 @@ class Session extends \Magento\Framework\Model\Resource\Db\AbstractDb * * @param \Magento\Framework\App\Resource $resource * @param \Magento\Persistent\Model\SessionFactory $sessionFactory + * @param string|null $resourcePrefix */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Persistent\Model\SessionFactory $sessionFactory + \Magento\Persistent\Model\SessionFactory $sessionFactory, + $resourcePrefix = null ) { $this->_sessionFactory = $sessionFactory; - parent::__construct($resource); + parent::__construct($resource, $resourcePrefix); } /** diff --git a/app/code/Magento/ProductAlert/Model/Resource/Price.php b/app/code/Magento/ProductAlert/Model/Resource/Price.php index b68c190d5c17b..685a65a4f06e0 100644 --- a/app/code/Magento/ProductAlert/Model/Resource/Price.php +++ b/app/code/Magento/ProductAlert/Model/Resource/Price.php @@ -18,11 +18,15 @@ class Price extends \Magento\ProductAlert\Model\Resource\AbstractResource /** * @param \Magento\Framework\App\Resource $resource * @param \Magento\Framework\Stdlib\DateTime\DateTimeFactory $dateFactory + * @param string|null $resourcePrefix */ - public function __construct(\Magento\Framework\App\Resource $resource, \Magento\Framework\Stdlib\DateTime\DateTimeFactory $dateFactory) - { + public function __construct( + \Magento\Framework\App\Resource $resource, + \Magento\Framework\Stdlib\DateTime\DateTimeFactory $dateFactory, + $resourcePrefix = null + ) { $this->_dateFactory = $dateFactory; - parent::__construct($resource); + parent::__construct($resource, $resourcePrefix); } /** diff --git a/app/code/Magento/ProductAlert/Model/Resource/Stock.php b/app/code/Magento/ProductAlert/Model/Resource/Stock.php index 6e48aee304c7a..0c0420cc5b254 100644 --- a/app/code/Magento/ProductAlert/Model/Resource/Stock.php +++ b/app/code/Magento/ProductAlert/Model/Resource/Stock.php @@ -18,11 +18,15 @@ class Stock extends \Magento\ProductAlert\Model\Resource\AbstractResource /** * @param \Magento\Framework\App\Resource $resource * @param \Magento\Framework\Stdlib\DateTime\DateTimeFactory $dateFactory + * @param string|null $resourcePrefix */ - public function __construct(\Magento\Framework\App\Resource $resource, \Magento\Framework\Stdlib\DateTime\DateTimeFactory $dateFactory) - { + public function __construct( + \Magento\Framework\App\Resource $resource, + \Magento\Framework\Stdlib\DateTime\DateTimeFactory $dateFactory, + $resourcePrefix = null + ) { $this->_dateFactory = $dateFactory; - parent::__construct($resource); + parent::__construct($resource, $resourcePrefix); } /** diff --git a/app/code/Magento/Reports/Model/Resource/Event.php b/app/code/Magento/Reports/Model/Resource/Event.php index 787e8d36c2810..4d71acc402d8c 100644 --- a/app/code/Magento/Reports/Model/Resource/Event.php +++ b/app/code/Magento/Reports/Model/Resource/Event.php @@ -26,13 +26,15 @@ class Event extends \Magento\Framework\Model\Resource\Db\AbstractDb * @param \Magento\Framework\App\Resource $resource * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Store\Model\StoreManagerInterface $storeManager + * @param string|null $resourcePrefix */ public function __construct( \Magento\Framework\App\Resource $resource, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, - \Magento\Store\Model\StoreManagerInterface $storeManager + \Magento\Store\Model\StoreManagerInterface $storeManager, + $resourcePrefix = null ) { - parent::__construct($resource); + parent::__construct($resource, $resourcePrefix); $this->_scopeConfig = $scopeConfig; $this->_storeManager = $storeManager; } diff --git a/app/code/Magento/Reports/Model/Resource/Product/Index/AbstractIndex.php b/app/code/Magento/Reports/Model/Resource/Product/Index/AbstractIndex.php index bbdc48439e66b..7ebeaf7c3b71e 100644 --- a/app/code/Magento/Reports/Model/Resource/Product/Index/AbstractIndex.php +++ b/app/code/Magento/Reports/Model/Resource/Product/Index/AbstractIndex.php @@ -24,13 +24,15 @@ abstract class AbstractIndex extends \Magento\Framework\Model\Resource\Db\Abstra * @param \Magento\Framework\App\Resource $resource * @param \Magento\Reports\Model\Resource\Helper $resourceHelper * @param \Magento\Framework\Stdlib\DateTime $dateTime + * @param string|null $resourcePrefix */ public function __construct( \Magento\Framework\App\Resource $resource, \Magento\Reports\Model\Resource\Helper $resourceHelper, - \Magento\Framework\Stdlib\DateTime $dateTime + \Magento\Framework\Stdlib\DateTime $dateTime, + $resourcePrefix = null ) { - parent::__construct($resource); + parent::__construct($resource, $resourcePrefix); $this->_resourceHelper = $resourceHelper; $this->dateTime = $dateTime; } diff --git a/app/code/Magento/Reports/Model/Resource/Report/AbstractReport.php b/app/code/Magento/Reports/Model/Resource/Report/AbstractReport.php index 3c74db144db62..b646b4abe4470 100644 --- a/app/code/Magento/Reports/Model/Resource/Report/AbstractReport.php +++ b/app/code/Magento/Reports/Model/Resource/Report/AbstractReport.php @@ -40,6 +40,7 @@ abstract class AbstractReport extends \Magento\Framework\Model\Resource\Db\Abstr * @param \Magento\Reports\Model\FlagFactory $reportsFlagFactory * @param \Magento\Framework\Stdlib\DateTime $dateTime * @param \Magento\Framework\Stdlib\DateTime\Timezone\Validator $timezoneValidator + * @param string|null $resourcePrefix */ public function __construct( \Magento\Framework\App\Resource $resource, @@ -47,9 +48,10 @@ public function __construct( \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate, \Magento\Reports\Model\FlagFactory $reportsFlagFactory, \Magento\Framework\Stdlib\DateTime $dateTime, - \Magento\Framework\Stdlib\DateTime\Timezone\Validator $timezoneValidator + \Magento\Framework\Stdlib\DateTime\Timezone\Validator $timezoneValidator, + $resourcePrefix = null ) { - parent::__construct($resource); + parent::__construct($resource, $resourcePrefix); $this->_logger = $logger; $this->_localeDate = $localeDate; $this->_reportsFlagFactory = $reportsFlagFactory; diff --git a/app/code/Magento/Reports/Model/Resource/Report/Product/Viewed.php b/app/code/Magento/Reports/Model/Resource/Report/Product/Viewed.php index e86195185f3ec..88d177a6e9c35 100644 --- a/app/code/Magento/Reports/Model/Resource/Report/Product/Viewed.php +++ b/app/code/Magento/Reports/Model/Resource/Report/Product/Viewed.php @@ -47,6 +47,7 @@ class Viewed extends \Magento\Sales\Model\Resource\Report\AbstractReport * @param \Magento\Framework\Stdlib\DateTime\Timezone\Validator $timezoneValidator * @param \Magento\Catalog\Model\Resource\Product $productResource * @param \Magento\Reports\Model\Resource\Helper $resourceHelper + * @param string|null $resourcePrefix */ public function __construct( \Magento\Framework\App\Resource $resource, @@ -56,9 +57,18 @@ public function __construct( \Magento\Framework\Stdlib\DateTime $dateTime, \Magento\Framework\Stdlib\DateTime\Timezone\Validator $timezoneValidator, \Magento\Catalog\Model\Resource\Product $productResource, - \Magento\Reports\Model\Resource\Helper $resourceHelper + \Magento\Reports\Model\Resource\Helper $resourceHelper, + $resourcePrefix = null ) { - parent::__construct($resource, $logger, $localeDate, $reportsFlagFactory, $dateTime, $timezoneValidator); + parent::__construct( + $resource, + $logger, + $localeDate, + $reportsFlagFactory, + $dateTime, + $timezoneValidator, + $resourcePrefix + ); $this->_productResource = $productResource; $this->_resourceHelper = $resourceHelper; } diff --git a/app/code/Magento/Review/Model/Resource/Rating.php b/app/code/Magento/Review/Model/Resource/Rating.php index dc360c221f78b..c6c989d4dcc3a 100644 --- a/app/code/Magento/Review/Model/Resource/Rating.php +++ b/app/code/Magento/Review/Model/Resource/Rating.php @@ -38,6 +38,7 @@ class Rating extends \Magento\Framework\Model\Resource\Db\AbstractDb * @param \Magento\Review\Helper\Data $ratingData * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Review\Model\Resource\Review\Summary $reviewSummary + * @param string|null $resourcePrefix */ public function __construct( \Magento\Framework\App\Resource $resource, @@ -45,13 +46,14 @@ public function __construct( \Magento\Framework\Module\Manager $moduleManager, \Magento\Review\Helper\Data $ratingData, \Magento\Store\Model\StoreManagerInterface $storeManager, - \Magento\Review\Model\Resource\Review\Summary $reviewSummary + \Magento\Review\Model\Resource\Review\Summary $reviewSummary, + $resourcePrefix = null ) { $this->moduleManager = $moduleManager; $this->_storeManager = $storeManager; $this->_logger = $logger; $this->_reviewSummary = $reviewSummary; - parent::__construct($resource); + parent::__construct($resource, $resourcePrefix); } /** diff --git a/app/code/Magento/Review/Model/Resource/Rating/Option.php b/app/code/Magento/Review/Model/Resource/Rating/Option.php index 4fe3af8124772..693d80175b1ed 100644 --- a/app/code/Magento/Review/Model/Resource/Rating/Option.php +++ b/app/code/Magento/Review/Model/Resource/Rating/Option.php @@ -83,17 +83,19 @@ class Option extends \Magento\Framework\Model\Resource\Db\AbstractDb * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Review\Model\Rating\Option\VoteFactory $ratingOptionVoteF * @param \Magento\Framework\HTTP\PhpEnvironment\RemoteAddress $remoteAddress + * @param string|null $resourcePrefix */ public function __construct( \Magento\Framework\App\Resource $resource, \Magento\Customer\Model\Session $customerSession, \Magento\Review\Model\Rating\Option\VoteFactory $ratingOptionVoteF, - \Magento\Framework\HTTP\PhpEnvironment\RemoteAddress $remoteAddress + \Magento\Framework\HTTP\PhpEnvironment\RemoteAddress $remoteAddress, + $resourcePrefix = null ) { $this->_customerSession = $customerSession; $this->_ratingOptionVoteF = $ratingOptionVoteF; $this->_remoteAddress = $remoteAddress; - parent::__construct($resource); + parent::__construct($resource, $resourcePrefix); } /** diff --git a/app/code/Magento/Review/Model/Resource/Review.php b/app/code/Magento/Review/Model/Resource/Review.php index c6383852b817b..1e7c09e92f6c5 100644 --- a/app/code/Magento/Review/Model/Resource/Review.php +++ b/app/code/Magento/Review/Model/Resource/Review.php @@ -95,20 +95,22 @@ class Review extends \Magento\Framework\Model\Resource\Db\AbstractDb * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Review\Model\RatingFactory $ratingFactory * @param \Magento\Review\Model\Resource\Rating\Option $ratingOptions + * * @param string|null $resourcePrefix */ public function __construct( \Magento\Framework\App\Resource $resource, \Magento\Framework\Stdlib\DateTime\DateTime $date, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Review\Model\RatingFactory $ratingFactory, - Rating\Option $ratingOptions + Rating\Option $ratingOptions, + $resourcePrefix = null ) { $this->_date = $date; $this->_storeManager = $storeManager; $this->_ratingFactory = $ratingFactory; $this->_ratingOptions = $ratingOptions; - parent::__construct($resource); + parent::__construct($resource, $resourcePrefix); } /** diff --git a/app/code/Magento/Sales/Model/Resource/AbstractGrid.php b/app/code/Magento/Sales/Model/Resource/AbstractGrid.php index dc2952e8b17ef..ec8941c2ba11f 100644 --- a/app/code/Magento/Sales/Model/Resource/AbstractGrid.php +++ b/app/code/Magento/Sales/Model/Resource/AbstractGrid.php @@ -34,14 +34,6 @@ abstract class AbstractGrid extends AbstractDb implements GridInterface */ protected $addressTableName = 'sales_order_address'; - /** - * @param AppResource $resource - */ - public function __construct(AppResource $resource) - { - parent::__construct($resource); - } - /** * Resource initialization * diff --git a/app/code/Magento/Sales/Model/Resource/Entity.php b/app/code/Magento/Sales/Model/Resource/Entity.php index f948734924783..c939532a87d8d 100644 --- a/app/code/Magento/Sales/Model/Resource/Entity.php +++ b/app/code/Magento/Sales/Model/Resource/Entity.php @@ -58,18 +58,20 @@ abstract class Entity extends AbstractDb * @param \Magento\Framework\App\Resource $resource * @param Attribute $attribute * @param \Magento\Sales\Model\Increment $salesIncrement + * @param string|null $resourcePrefix * @param GridInterface|null $gridAggregator */ public function __construct( \Magento\Framework\App\Resource $resource, \Magento\Sales\Model\Resource\Attribute $attribute, \Magento\Sales\Model\Increment $salesIncrement, + $resourcePrefix = null, \Magento\Sales\Model\Resource\GridInterface $gridAggregator = null ) { $this->attribute = $attribute; $this->salesIncrement = $salesIncrement; $this->gridAggregator = $gridAggregator; - parent::__construct($resource); + parent::__construct($resource, $resourcePrefix); } /** diff --git a/app/code/Magento/Sales/Model/Resource/Order.php b/app/code/Magento/Sales/Model/Resource/Order.php index df3a1eb09a983..2db824d7bb0b5 100644 --- a/app/code/Magento/Sales/Model/Resource/Order.php +++ b/app/code/Magento/Sales/Model/Resource/Order.php @@ -62,6 +62,7 @@ protected function _construct() * @param AddressHandler $addressHandler * @param StateHandler $stateHandler * @param OrderGrid $gridAggregator + * @param string|null $resourcePrefix */ public function __construct( AppResource $resource, @@ -69,11 +70,12 @@ public function __construct( SalesIncrement $salesIncrement, AddressHandler $addressHandler, StateHandler $stateHandler, - OrderGrid $gridAggregator + OrderGrid $gridAggregator, + $resourcePrefix = null ) { $this->stateHandler = $stateHandler; $this->addressHandler = $addressHandler; - parent::__construct($resource, $attribute, $salesIncrement, $gridAggregator); + parent::__construct($resource, $attribute, $salesIncrement, $resourcePrefix, $gridAggregator); } /** diff --git a/app/code/Magento/Sales/Model/Resource/Order/Address.php b/app/code/Magento/Sales/Model/Resource/Order/Address.php index 64def18706927..80fc0cee41a9d 100644 --- a/app/code/Magento/Sales/Model/Resource/Order/Address.php +++ b/app/code/Magento/Sales/Model/Resource/Order/Address.php @@ -37,6 +37,7 @@ class Address extends SalesResource implements OrderAddressResourceInterface * @param \Magento\Sales\Model\Order\Address\Validator $validator * @param \Magento\Sales\Model\Resource\GridPool $gridPool * @param \Magento\Sales\Model\Resource\GridInterface $gridAggregator + * @param string|null $resourcePrefix */ public function __construct( \Magento\Framework\App\Resource $resource, @@ -44,11 +45,12 @@ public function __construct( \Magento\Sales\Model\Increment $salesIncrement, \Magento\Sales\Model\Order\Address\Validator $validator, \Magento\Sales\Model\Resource\GridPool $gridPool, - \Magento\Sales\Model\Resource\GridInterface $gridAggregator = null + \Magento\Sales\Model\Resource\GridInterface $gridAggregator = null, + $resourcePrefix = null ) { $this->_validator = $validator; $this->gridPool = $gridPool; - parent::__construct($resource, $attribute, $salesIncrement, $gridAggregator); + parent::__construct($resource, $attribute, $salesIncrement, $gridAggregator, $resourcePrefix); } /** diff --git a/app/code/Magento/Sales/Model/Resource/Order/Creditmemo.php b/app/code/Magento/Sales/Model/Resource/Order/Creditmemo.php index cc23c0550e475..861803271c429 100644 --- a/app/code/Magento/Sales/Model/Resource/Order/Creditmemo.php +++ b/app/code/Magento/Sales/Model/Resource/Order/Creditmemo.php @@ -43,14 +43,16 @@ protected function _construct() * @param Attribute $attribute * @param SalesIncrement $salesIncrement * @param CreditmemoGrid $gridAggregator + * @param string|null $resourcePrefix */ public function __construct( AppResource $resource, Attribute $attribute, SalesIncrement $salesIncrement, - CreditmemoGrid $gridAggregator + CreditmemoGrid $gridAggregator, + $resourcePrefix = null ) { - parent::__construct($resource, $attribute, $salesIncrement, $gridAggregator); + parent::__construct($resource, $attribute, $salesIncrement, $gridAggregator, $resourcePrefix); } /** diff --git a/app/code/Magento/Sales/Model/Resource/Order/Creditmemo/Comment.php b/app/code/Magento/Sales/Model/Resource/Order/Creditmemo/Comment.php index 252c75881b67a..f3fc4df88b7f8 100644 --- a/app/code/Magento/Sales/Model/Resource/Order/Creditmemo/Comment.php +++ b/app/code/Magento/Sales/Model/Resource/Order/Creditmemo/Comment.php @@ -35,16 +35,18 @@ class Comment extends Entity implements CreditmemoCommentResourceInterface * @param \Magento\Sales\Model\Increment $salesIncrement * @param \Magento\Sales\Model\Order\Creditmemo\Comment\Validator $validator * @param \Magento\Sales\Model\Resource\GridInterface $gridAggregator + * @param string|null $resourcePrefix */ public function __construct( \Magento\Framework\App\Resource $resource, \Magento\Sales\Model\Resource\Attribute $attribute, \Magento\Sales\Model\Increment $salesIncrement, \Magento\Sales\Model\Order\Creditmemo\Comment\Validator $validator, - \Magento\Sales\Model\Resource\GridInterface $gridAggregator = null + \Magento\Sales\Model\Resource\GridInterface $gridAggregator = null, + $resourcePrefix = null ) { $this->validator = $validator; - parent::__construct($resource, $attribute, $salesIncrement, $gridAggregator); + parent::__construct($resource, $attribute, $salesIncrement, $gridAggregator, $resourcePrefix); } /** diff --git a/app/code/Magento/Sales/Model/Resource/Order/Invoice.php b/app/code/Magento/Sales/Model/Resource/Order/Invoice.php index 6daf36254290c..928bc21d723b3 100644 --- a/app/code/Magento/Sales/Model/Resource/Order/Invoice.php +++ b/app/code/Magento/Sales/Model/Resource/Order/Invoice.php @@ -39,14 +39,16 @@ protected function _construct() * @param Attribute $attribute * @param SalesIncrement $salesIncrement * @param InvoiceGrid $gridAggregator + * @param string|null $resourcePrefix */ public function __construct( Resource $resource, Attribute $attribute, SalesIncrement $salesIncrement, - InvoiceGrid $gridAggregator + InvoiceGrid $gridAggregator, + $resourcePrefix = null ) { - parent::__construct($resource, $attribute, $salesIncrement, $gridAggregator); + parent::__construct($resource, $attribute, $salesIncrement, $gridAggregator, $resourcePrefix); } /** diff --git a/app/code/Magento/Sales/Model/Resource/Order/Invoice/Comment.php b/app/code/Magento/Sales/Model/Resource/Order/Invoice/Comment.php index 51b72132553ad..8568c5728b9a7 100644 --- a/app/code/Magento/Sales/Model/Resource/Order/Invoice/Comment.php +++ b/app/code/Magento/Sales/Model/Resource/Order/Invoice/Comment.php @@ -35,16 +35,18 @@ class Comment extends Entity implements InvoiceCommentResourceInterface * @param \Magento\Sales\Model\Increment $salesIncrement * @param \Magento\Sales\Model\Order\Invoice\Comment\Validator $validator * @param \Magento\Sales\Model\Resource\GridInterface $gridAggregator + * @param string|null $resourcePrefix */ public function __construct( \Magento\Framework\App\Resource $resource, \Magento\Sales\Model\Resource\Attribute $attribute, \Magento\Sales\Model\Increment $salesIncrement, \Magento\Sales\Model\Order\Invoice\Comment\Validator $validator, - \Magento\Sales\Model\Resource\GridInterface $gridAggregator = null + \Magento\Sales\Model\Resource\GridInterface $gridAggregator = null, + $resourcePrefix = null ) { $this->validator = $validator; - parent::__construct($resource, $attribute, $salesIncrement, $gridAggregator); + parent::__construct($resource, $attribute, $salesIncrement, $gridAggregator, $resourcePrefix); } /** diff --git a/app/code/Magento/Sales/Model/Resource/Order/Shipment.php b/app/code/Magento/Sales/Model/Resource/Order/Shipment.php index bb8b98bb0c89f..7696cb13cae83 100644 --- a/app/code/Magento/Sales/Model/Resource/Order/Shipment.php +++ b/app/code/Magento/Sales/Model/Resource/Order/Shipment.php @@ -48,14 +48,16 @@ protected function _construct() * @param Attribute $attribute * @param SalesIncrement $salesIncrement * @param ShipmentGrid $gridAggregator + * @param string|null $resourcePrefix */ public function __construct( AppResource $resource, Attribute $attribute, SalesIncrement $salesIncrement, - ShipmentGrid $gridAggregator + ShipmentGrid $gridAggregator, + $resourcePrefix = null ) { - parent::__construct($resource, $attribute, $salesIncrement, $gridAggregator); + parent::__construct($resource, $attribute, $salesIncrement, $gridAggregator, $resourcePrefix); } /** diff --git a/app/code/Magento/Sales/Model/Resource/Order/Shipment/Comment.php b/app/code/Magento/Sales/Model/Resource/Order/Shipment/Comment.php index 822060f8bec2f..b5ad3ad8a29a5 100644 --- a/app/code/Magento/Sales/Model/Resource/Order/Shipment/Comment.php +++ b/app/code/Magento/Sales/Model/Resource/Order/Shipment/Comment.php @@ -35,16 +35,18 @@ class Comment extends Entity implements ShipmentCommentResourceInterface * @param \Magento\Sales\Model\Increment $salesIncrement * @param \Magento\Sales\Model\Order\Shipment\Comment\Validator $validator * @param \Magento\Sales\Model\Resource\GridInterface $gridAggregator + * @param string|null $resourcePrefix */ public function __construct( \Magento\Framework\App\Resource $resource, \Magento\Sales\Model\Resource\Attribute $attribute, \Magento\Sales\Model\Increment $salesIncrement, \Magento\Sales\Model\Order\Shipment\Comment\Validator $validator, - \Magento\Sales\Model\Resource\GridInterface $gridAggregator = null + \Magento\Sales\Model\Resource\GridInterface $gridAggregator = null, + $resourcePrefix = null ) { $this->validator = $validator; - parent::__construct($resource, $attribute, $salesIncrement, $gridAggregator); + parent::__construct($resource, $attribute, $salesIncrement, $gridAggregator, $resourcePrefix); } /** diff --git a/app/code/Magento/Sales/Model/Resource/Order/Shipment/Track.php b/app/code/Magento/Sales/Model/Resource/Order/Shipment/Track.php index ecbc6d3586052..54e2575aa6448 100644 --- a/app/code/Magento/Sales/Model/Resource/Order/Shipment/Track.php +++ b/app/code/Magento/Sales/Model/Resource/Order/Shipment/Track.php @@ -35,16 +35,18 @@ class Track extends SalesResource implements ShipmentTrackResourceInterface * @param \Magento\Sales\Model\Increment $salesIncrement * @param \Magento\Sales\Model\Order\Shipment\Track\Validator $validator * @param \Magento\Sales\Model\Resource\GridInterface $gridAggregator + * @param string|null $resourcePrefix */ public function __construct( \Magento\Framework\App\Resource $resource, \Magento\Sales\Model\Resource\Attribute $attribute, \Magento\Sales\Model\Increment $salesIncrement, \Magento\Sales\Model\Order\Shipment\Track\Validator $validator, - \Magento\Sales\Model\Resource\GridInterface $gridAggregator = null + \Magento\Sales\Model\Resource\GridInterface $gridAggregator = null, + $resourcePrefix = null ) { $this->validator = $validator; - parent::__construct($resource, $attribute, $salesIncrement, $gridAggregator); + parent::__construct($resource, $attribute, $salesIncrement, $gridAggregator, $resourcePrefix); } /** diff --git a/app/code/Magento/Sales/Model/Resource/Order/Status.php b/app/code/Magento/Sales/Model/Resource/Order/Status.php index e013a4a85c101..62711cf038d52 100644 --- a/app/code/Magento/Sales/Model/Resource/Order/Status.php +++ b/app/code/Magento/Sales/Model/Resource/Order/Status.php @@ -40,13 +40,15 @@ class Status extends \Magento\Framework\Model\Resource\Db\AbstractDb * * @param \Magento\Framework\App\Resource $resource * @param LogWriter $logger + * @param string|null $resourcePrefix */ public function __construct( Resource $resource, - LogWriter $logger + LogWriter $logger, + $resourcePrefix = null ) { $this->logger = $logger; - parent::__construct($resource); + parent::__construct($resource, $resourcePrefix); } /** diff --git a/app/code/Magento/Sales/Model/Resource/Order/Status/History.php b/app/code/Magento/Sales/Model/Resource/Order/Status/History.php index 723fdc506a9a0..59433e438af96 100644 --- a/app/code/Magento/Sales/Model/Resource/Order/Status/History.php +++ b/app/code/Magento/Sales/Model/Resource/Order/Status/History.php @@ -23,21 +23,22 @@ class History extends Entity implements OrderStatusHistoryResourceInterface /** * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Stdlib\DateTime $dateTime * @param \Magento\Sales\Model\Resource\Attribute $attribute * @param \Magento\Sales\Model\Increment $salesIncrement * @param Validator $validator * @param \Magento\Sales\Model\Resource\GridInterface $gridAggregator + * @param string|null $resourcePrefix */ public function __construct( \Magento\Framework\App\Resource $resource, \Magento\Sales\Model\Resource\Attribute $attribute, \Magento\Sales\Model\Increment $salesIncrement, Validator $validator, - \Magento\Sales\Model\Resource\GridInterface $gridAggregator = null + \Magento\Sales\Model\Resource\GridInterface $gridAggregator = null, + $resourcePrefix = null ) { $this->validator = $validator; - parent::__construct($resource, $attribute, $salesIncrement, $gridAggregator); + parent::__construct($resource, $attribute, $salesIncrement, $gridAggregator, $resourcePrefix); } /** diff --git a/app/code/Magento/Sales/Model/Resource/Quote.php b/app/code/Magento/Sales/Model/Resource/Quote.php index e289000db6ee2..fb05740bb6e1f 100644 --- a/app/code/Magento/Sales/Model/Resource/Quote.php +++ b/app/code/Magento/Sales/Model/Resource/Quote.php @@ -20,12 +20,14 @@ class Quote extends AbstractDb /** * @param \Magento\Framework\App\Resource $resource * @param \Magento\Eav\Model\Config $config + * @param string|null $resourcePrefix */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Eav\Model\Config $config + \Magento\Eav\Model\Config $config, + $resourcePrefix = null ) { - parent::__construct($resource); + parent::__construct($resource, $resourcePrefix); $this->_config = $config; } diff --git a/app/code/Magento/Sales/Model/Resource/Quote/Payment.php b/app/code/Magento/Sales/Model/Resource/Quote/Payment.php index fbd9bff880153..ebacef254b13f 100644 --- a/app/code/Magento/Sales/Model/Resource/Quote/Payment.php +++ b/app/code/Magento/Sales/Model/Resource/Quote/Payment.php @@ -19,15 +19,6 @@ class Payment extends AbstractDb */ protected $_serializableFields = ['additional_information' => [null, []]]; - /** - * @param \Magento\Framework\App\Resource $resource - */ - public function __construct( - \Magento\Framework\App\Resource $resource - ) { - parent::__construct($resource); - } - /** * Main table and field initialization * diff --git a/app/code/Magento/Sales/Model/Resource/Report/Bestsellers.php b/app/code/Magento/Sales/Model/Resource/Report/Bestsellers.php index 4ff7e5878c0cf..96f44942dcb50 100644 --- a/app/code/Magento/Sales/Model/Resource/Report/Bestsellers.php +++ b/app/code/Magento/Sales/Model/Resource/Report/Bestsellers.php @@ -45,6 +45,7 @@ class Bestsellers extends AbstractReport * @param \Magento\Catalog\Model\Resource\Product $productResource * @param \Magento\Sales\Model\Resource\Helper $salesResourceHelper * @param array $ignoredProductTypes + * @param string|null $resourcePrefix */ public function __construct( \Magento\Framework\App\Resource $resource, @@ -55,9 +56,18 @@ public function __construct( \Magento\Framework\Stdlib\DateTime\Timezone\Validator $timezoneValidator, \Magento\Catalog\Model\Resource\Product $productResource, \Magento\Sales\Model\Resource\Helper $salesResourceHelper, + $resourcePrefix = null, array $ignoredProductTypes = [] ) { - parent::__construct($resource, $logger, $localeDate, $reportsFlagFactory, $dateTime, $timezoneValidator); + parent::__construct( + $resource, + $logger, + $localeDate, + $reportsFlagFactory, + $dateTime, + $timezoneValidator, + $resourcePrefix + ); $this->_productResource = $productResource; $this->_salesResourceHelper = $salesResourceHelper; $this->ignoredProductTypes = array_merge($this->ignoredProductTypes, $ignoredProductTypes); diff --git a/app/code/Magento/Sales/Model/Resource/Report/Order.php b/app/code/Magento/Sales/Model/Resource/Report/Order.php index 50a03c50638ef..6f95d746efaf6 100644 --- a/app/code/Magento/Sales/Model/Resource/Report/Order.php +++ b/app/code/Magento/Sales/Model/Resource/Report/Order.php @@ -29,6 +29,7 @@ class Order extends AbstractReport * @param \Magento\Framework\Stdlib\DateTime\Timezone\Validator $timezoneValidator * @param \Magento\Sales\Model\Resource\Report\Order\CreatedatFactory $createDatFactory * @param \Magento\Sales\Model\Resource\Report\Order\UpdatedatFactory $updateDatFactory + * @param string|null $resourcePrefix */ public function __construct( \Magento\Framework\App\Resource $resource, @@ -38,9 +39,17 @@ public function __construct( \Magento\Framework\Stdlib\DateTime $dateTime, \Magento\Framework\Stdlib\DateTime\Timezone\Validator $timezoneValidator, \Magento\Sales\Model\Resource\Report\Order\CreatedatFactory $createDatFactory, - \Magento\Sales\Model\Resource\Report\Order\UpdatedatFactory $updateDatFactory + \Magento\Sales\Model\Resource\Report\Order\UpdatedatFactory $updateDatFactory, + $resourcePrefix = null ) { - parent::__construct($resource, $logger, $localeDate, $reportsFlagFactory, $dateTime, $timezoneValidator); + parent::__construct($resource, + $logger, + $localeDate, + $reportsFlagFactory, + $dateTime, + $timezoneValidator, + $resourcePrefix + ); $this->_createDatFactory = $createDatFactory; $this->_updateDatFactory = $updateDatFactory; } diff --git a/app/code/Magento/SalesRule/Model/Resource/Report/Rule.php b/app/code/Magento/SalesRule/Model/Resource/Report/Rule.php index 761804a0754e4..34edc5e31670a 100644 --- a/app/code/Magento/SalesRule/Model/Resource/Report/Rule.php +++ b/app/code/Magento/SalesRule/Model/Resource/Report/Rule.php @@ -31,6 +31,7 @@ class Rule extends \Magento\Reports\Model\Resource\Report\AbstractReport * @param \Magento\Framework\Stdlib\DateTime\Timezone\Validator $timezoneValidator * @param \Magento\SalesRule\Model\Resource\Report\Rule\CreatedatFactory $createdatFactory * @param \Magento\SalesRule\Model\Resource\Report\Rule\UpdatedatFactory $updatedatFactory + * @param string|null $resourcePrefix */ public function __construct( \Magento\Framework\App\Resource $resource, @@ -40,9 +41,18 @@ public function __construct( \Magento\Framework\Stdlib\DateTime $dateTime, \Magento\Framework\Stdlib\DateTime\Timezone\Validator $timezoneValidator, \Magento\SalesRule\Model\Resource\Report\Rule\CreatedatFactory $createdatFactory, - \Magento\SalesRule\Model\Resource\Report\Rule\UpdatedatFactory $updatedatFactory + \Magento\SalesRule\Model\Resource\Report\Rule\UpdatedatFactory $updatedatFactory, + $resourcePrefix = null ) { - parent::__construct($resource, $logger, $localeDate, $reportsFlagFactory, $dateTime, $timezoneValidator); + parent::__construct( + $resource, + $logger, + $localeDate, + $reportsFlagFactory, + $dateTime, + $timezoneValidator, + $resourcePrefix + ); $this->_createdatFactory = $createdatFactory; $this->_updatedatFactory = $updatedatFactory; } diff --git a/app/code/Magento/SalesRule/Model/Resource/Rule.php b/app/code/Magento/SalesRule/Model/Resource/Rule.php index cfe744acdc2b4..832063afb6c15 100644 --- a/app/code/Magento/SalesRule/Model/Resource/Rule.php +++ b/app/code/Magento/SalesRule/Model/Resource/Rule.php @@ -46,15 +46,17 @@ class Rule extends \Magento\Rule\Model\Resource\AbstractResource * @param \Magento\Framework\App\Resource $resource * @param \Magento\Framework\Stdlib\String $string * @param \Magento\SalesRule\Model\Resource\Coupon $resourceCoupon + * @param string|null $resourcePrefix */ public function __construct( \Magento\Framework\App\Resource $resource, \Magento\Framework\Stdlib\String $string, - \Magento\SalesRule\Model\Resource\Coupon $resourceCoupon + \Magento\SalesRule\Model\Resource\Coupon $resourceCoupon, + $resourcePrefix = null ) { $this->string = $string; $this->_resourceCoupon = $resourceCoupon; - parent::__construct($resource); + parent::__construct($resource, $resourcePrefix); } /** diff --git a/app/code/Magento/Search/Model/Resource/Query.php b/app/code/Magento/Search/Model/Resource/Query.php index 855d5fa38faf8..6526c693affd9 100644 --- a/app/code/Magento/Search/Model/Resource/Query.php +++ b/app/code/Magento/Search/Model/Resource/Query.php @@ -31,15 +31,17 @@ class Query extends AbstractDb * @param \Magento\Framework\App\Resource $resource * @param \Magento\Framework\Stdlib\DateTime\DateTime $date * @param \Magento\Framework\Stdlib\DateTime $dateTime + * @param string|null $resourcePrefix */ public function __construct( \Magento\Framework\App\Resource $resource, \Magento\Framework\Stdlib\DateTime\DateTime $date, - \Magento\Framework\Stdlib\DateTime $dateTime + \Magento\Framework\Stdlib\DateTime $dateTime, + $resourcePrefix = null ) { $this->_date = $date; $this->dateTime = $dateTime; - parent::__construct($resource); + parent::__construct($resource, $resourcePrefix); } /** diff --git a/app/code/Magento/Sitemap/Model/Resource/Catalog/Category.php b/app/code/Magento/Sitemap/Model/Resource/Catalog/Category.php index acb50839e3132..29211577c7e84 100644 --- a/app/code/Magento/Sitemap/Model/Resource/Catalog/Category.php +++ b/app/code/Magento/Sitemap/Model/Resource/Catalog/Category.php @@ -42,15 +42,17 @@ class Category extends \Magento\Framework\Model\Resource\Db\AbstractDb * @param \Magento\Framework\App\Resource $resource * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Model\Resource\Category $categoryResource + * @param string|null $resourcePrefix */ public function __construct( \Magento\Framework\App\Resource $resource, \Magento\Store\Model\StoreManagerInterface $storeManager, - \Magento\Catalog\Model\Resource\Category $categoryResource + \Magento\Catalog\Model\Resource\Category $categoryResource, + $resourcePrefix = null ) { $this->_storeManager = $storeManager; $this->_categoryResource = $categoryResource; - parent::__construct($resource); + parent::__construct($resource, $resourcePrefix); } /** diff --git a/app/code/Magento/Sitemap/Model/Resource/Catalog/Product.php b/app/code/Magento/Sitemap/Model/Resource/Catalog/Product.php index 9f7b3200e89dd..410ad5ebda10b 100644 --- a/app/code/Magento/Sitemap/Model/Resource/Catalog/Product.php +++ b/app/code/Magento/Sitemap/Model/Resource/Catalog/Product.php @@ -91,6 +91,7 @@ class Product extends \Magento\Framework\Model\Resource\Db\AbstractDb * @param \Magento\Catalog\Model\Resource\Product\Attribute\Backend\Media $mediaAttribute * @param \Magento\Eav\Model\ConfigFactory $eavConfigFactory * @param \Magento\Catalog\Model\Product\Media\Config $mediaConfig + * @param string|null $resourcePrefix */ public function __construct( \Magento\Framework\App\Resource $resource, @@ -101,7 +102,8 @@ public function __construct( \Magento\Catalog\Model\Product\Attribute\Source\Status $productStatus, \Magento\Catalog\Model\Resource\Product\Attribute\Backend\Media $mediaAttribute, \Magento\Eav\Model\ConfigFactory $eavConfigFactory, - \Magento\Catalog\Model\Product\Media\Config $mediaConfig + \Magento\Catalog\Model\Product\Media\Config $mediaConfig, + $resourcePrefix = null ) { $this->_productResource = $productResource; $this->_storeManager = $storeManager; @@ -111,7 +113,7 @@ public function __construct( $this->_eavConfigFactory = $eavConfigFactory; $this->_mediaConfig = $mediaConfig; $this->_sitemapData = $sitemapData; - parent::__construct($resource); + parent::__construct($resource, $resourcePrefix); } /** diff --git a/app/code/Magento/Tax/Model/Resource/Calculation.php b/app/code/Magento/Tax/Model/Resource/Calculation.php index 5ce230adbe950..535bf62b726d7 100644 --- a/app/code/Magento/Tax/Model/Resource/Calculation.php +++ b/app/code/Magento/Tax/Model/Resource/Calculation.php @@ -47,15 +47,17 @@ class Calculation extends \Magento\Framework\Model\Resource\Db\AbstractDb * @param \Magento\Framework\App\Resource $resource * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\Store\Model\StoreManagerInterface $storeManager + * @param string|null $resourcePrefix */ public function __construct( \Magento\Framework\App\Resource $resource, \Magento\Tax\Helper\Data $taxData, - \Magento\Store\Model\StoreManagerInterface $storeManager + \Magento\Store\Model\StoreManagerInterface $storeManager, + $resourcePrefix = null ) { $this->_taxData = $taxData; $this->_storeManager = $storeManager; - parent::__construct($resource); + parent::__construct($resource, $resourcePrefix); } /** diff --git a/app/code/Magento/Tax/Model/Resource/Report/Tax.php b/app/code/Magento/Tax/Model/Resource/Report/Tax.php index 7b0e847ff4ea0..cacd9c4660cf4 100644 --- a/app/code/Magento/Tax/Model/Resource/Report/Tax.php +++ b/app/code/Magento/Tax/Model/Resource/Report/Tax.php @@ -30,6 +30,7 @@ class Tax extends \Magento\Reports\Model\Resource\Report\AbstractReport * @param \Magento\Framework\Stdlib\DateTime\Timezone\Validator $timezoneValidator * @param \Magento\Tax\Model\Resource\Report\Tax\CreatedatFactory $createdAtFactory * @param \Magento\Tax\Model\Resource\Report\Tax\UpdatedatFactory $updatedAtFactory + * @param string|null $resourcePrefix */ public function __construct( \Magento\Framework\App\Resource $resource, @@ -39,11 +40,20 @@ public function __construct( \Magento\Framework\Stdlib\DateTime $dateTime, \Magento\Framework\Stdlib\DateTime\Timezone\Validator $timezoneValidator, \Magento\Tax\Model\Resource\Report\Tax\CreatedatFactory $createdAtFactory, - \Magento\Tax\Model\Resource\Report\Tax\UpdatedatFactory $updatedAtFactory + \Magento\Tax\Model\Resource\Report\Tax\UpdatedatFactory $updatedAtFactory, + $resourcePrefix = null ) { $this->_createdAtFactory = $createdAtFactory; $this->_updatedAtFactory = $updatedAtFactory; - parent::__construct($resource, $logger, $localeDate, $reportsFlagFactory, $dateTime, $timezoneValidator); + parent::__construct( + $resource, + $logger, + $localeDate, + $reportsFlagFactory, + $dateTime, + $timezoneValidator, + $resourcePrefix + ); } /** diff --git a/app/code/Magento/Translation/Model/Resource/String.php b/app/code/Magento/Translation/Model/Resource/String.php index c620c322528f2..f1be72b401387 100644 --- a/app/code/Magento/Translation/Model/Resource/String.php +++ b/app/code/Magento/Translation/Model/Resource/String.php @@ -26,18 +26,20 @@ class String extends \Magento\Framework\Model\Resource\Db\AbstractDb * @param \Magento\Framework\App\Resource $resource * @param \Magento\Framework\Locale\ResolverInterface $localeResolver * @param \Magento\Framework\App\ScopeResolverInterface $scopeResolver + * @param string|null $resourcePrefix * @param string|null $scope */ public function __construct( \Magento\Framework\App\Resource $resource, \Magento\Framework\Locale\ResolverInterface $localeResolver, \Magento\Framework\App\ScopeResolverInterface $scopeResolver, + $resourcePrefix = null, $scope = null ) { $this->_localeResolver = $localeResolver; $this->scopeResolver = $scopeResolver; $this->scope = $scope; - parent::__construct($resource); + parent::__construct($resource, $resourcePrefix); } /** diff --git a/app/code/Magento/Translation/Model/Resource/Translate.php b/app/code/Magento/Translation/Model/Resource/Translate.php index b670825e370ba..5cd93e306fb7e 100644 --- a/app/code/Magento/Translation/Model/Resource/Translate.php +++ b/app/code/Magento/Translation/Model/Resource/Translate.php @@ -21,16 +21,18 @@ class Translate extends \Magento\Framework\Model\Resource\Db\AbstractDb implemen /** * @param \Magento\Framework\App\Resource $resource * @param \Magento\Framework\App\ScopeResolverInterface $scopeResolver + * @param string|null $resourcePrefix * @param null|string $scope */ public function __construct( \Magento\Framework\App\Resource $resource, \Magento\Framework\App\ScopeResolverInterface $scopeResolver, + $resourcePrefix = null, $scope = null ) { $this->scopeResolver = $scopeResolver; $this->scope = $scope; - parent::__construct($resource); + parent::__construct($resource, $resourcePrefix); } /** diff --git a/app/code/Magento/User/Model/Resource/User.php b/app/code/Magento/User/Model/Resource/User.php index 1012a360aa651..46d6ee452878f 100644 --- a/app/code/Magento/User/Model/Resource/User.php +++ b/app/code/Magento/User/Model/Resource/User.php @@ -46,14 +46,16 @@ class User extends \Magento\Framework\Model\Resource\Db\AbstractDb * @param \Magento\Framework\Acl\CacheInterface $aclCache * @param \Magento\Authorization\Model\RoleFactory $roleFactory * @param \Magento\Framework\Stdlib\DateTime $dateTime + * @param string|null $resourcePrefix */ public function __construct( \Magento\Framework\App\Resource $resource, \Magento\Framework\Acl\CacheInterface $aclCache, \Magento\Authorization\Model\RoleFactory $roleFactory, - \Magento\Framework\Stdlib\DateTime $dateTime + \Magento\Framework\Stdlib\DateTime $dateTime, + $resourcePrefix = null ) { - parent::__construct($resource); + parent::__construct($resource, $resourcePrefix); $this->_aclCache = $aclCache; $this->_roleFactory = $roleFactory; $this->dateTime = $dateTime; diff --git a/app/code/Magento/Weee/Model/Resource/Attribute/Backend/Weee/Tax.php b/app/code/Magento/Weee/Model/Resource/Attribute/Backend/Weee/Tax.php index c4eaa41704c65..9489352f884b7 100644 --- a/app/code/Magento/Weee/Model/Resource/Attribute/Backend/Weee/Tax.php +++ b/app/code/Magento/Weee/Model/Resource/Attribute/Backend/Weee/Tax.php @@ -20,13 +20,15 @@ class Tax extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource * @param \Magento\Store\Model\StoreManagerInterface $storeManager + * @param string|null $resourcePrefix */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Store\Model\StoreManagerInterface $storeManager + \Magento\Store\Model\StoreManagerInterface $storeManager, + $resourcePrefix = null ) { $this->_storeManager = $storeManager; - parent::__construct($resource); + parent::__construct($resource, $resourcePrefix); } /** diff --git a/app/code/Magento/Weee/Model/Resource/Tax.php b/app/code/Magento/Weee/Model/Resource/Tax.php index 54386958b5290..53d4bef65ef78 100644 --- a/app/code/Magento/Weee/Model/Resource/Tax.php +++ b/app/code/Magento/Weee/Model/Resource/Tax.php @@ -21,11 +21,15 @@ class Tax extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource * @param \Magento\Framework\Stdlib\DateTime $dateTime + * @param string|null $resourcePrefix */ - public function __construct(\Magento\Framework\App\Resource $resource, \Magento\Framework\Stdlib\DateTime $dateTime) - { + public function __construct( + \Magento\Framework\App\Resource $resource, + \Magento\Framework\Stdlib\DateTime $dateTime, + $resourcePrefix = null + ) { $this->dateTime = $dateTime; - parent::__construct($resource); + parent::__construct($resource, $resourcePrefix); } /** diff --git a/lib/internal/Magento/Framework/App/Resource.php b/lib/internal/Magento/Framework/App/Resource.php index 2becb49921eb9..631dec1a33e7a 100644 --- a/lib/internal/Magento/Framework/App/Resource.php +++ b/lib/internal/Magento/Framework/App/Resource.php @@ -115,9 +115,10 @@ public function getConnection($resourceName) * Get resource table name, validated by db adapter * * @param string|string[] $modelEntity + * @param string $connectionName * @return string */ - public function getTableName($modelEntity) + public function getTableName($modelEntity, $connectionName = self::DEFAULT_READ_RESOURCE) { $tableSuffix = null; if (is_array($modelEntity)) { @@ -139,7 +140,7 @@ public function getTableName($modelEntity) if ($tableSuffix) { $tableName .= '_' . $tableSuffix; } - return $this->getConnection(self::DEFAULT_READ_RESOURCE)->getTableName($tableName); + return $this->getConnection($connectionName)->getTableName($tableName); } /** diff --git a/lib/internal/Magento/Framework/Model/Resource/Db/AbstractDb.php b/lib/internal/Magento/Framework/Model/Resource/Db/AbstractDb.php index 1913652a13297..3a98b783401a1 100644 --- a/lib/internal/Magento/Framework/Model/Resource/Db/AbstractDb.php +++ b/lib/internal/Magento/Framework/Model/Resource/Db/AbstractDb.php @@ -118,10 +118,14 @@ abstract class AbstractDb extends \Magento\Framework\Model\Resource\AbstractReso * Class constructor * * @param \Magento\Framework\App\Resource $resource + * @param string|null $resourcePrefix */ - public function __construct(\Magento\Framework\App\Resource $resource) + public function __construct(\Magento\Framework\App\Resource $resource, $resourcePrefix = null) { $this->_resources = $resource; + if (!is_null($resourcePrefix)) { + $this->_resourcePrefix = $resourcePrefix; + } parent::__construct(); } @@ -259,7 +263,8 @@ public function getTable($tableName) } if (!isset($this->_tables[$cacheName])) { - $this->_tables[$cacheName] = $this->_resources->getTableName($tableName); + $connectionName = $this->_resourcePrefix . '_read'; + $this->_tables[$cacheName] = $this->_resources->getTableName($tableName, $connectionName); } return $this->_tables[$cacheName]; } From c10d5ab6f997876287d5ded9aeb555544cbbc33e Mon Sep 17 00:00:00 2001 From: Serhiy Shkolyarenko Date: Mon, 26 Jan 2015 13:48:00 +0200 Subject: [PATCH 02/44] MAGETWO-32970: Prepare configurable connection name fixed constructors --- .../Resource/Import/CustomerComposite/Data.php | 2 +- .../Sales/Model/Resource/Order/Address.php | 2 +- .../Model/Resource/Order/Creditmemo/Comment.php | 2 +- .../Model/Resource/Order/Shipment/Track.php | 2 +- .../Model/Resource/Order/Status/History.php | 2 +- .../Import/CustomerComposite/DataTest.php | 17 +++++++++++++---- 6 files changed, 18 insertions(+), 9 deletions(-) diff --git a/app/code/Magento/CustomerImportExport/Model/Resource/Import/CustomerComposite/Data.php b/app/code/Magento/CustomerImportExport/Model/Resource/Import/CustomerComposite/Data.php index 5310383b942f0..ebc16d1064642 100644 --- a/app/code/Magento/CustomerImportExport/Model/Resource/Import/CustomerComposite/Data.php +++ b/app/code/Magento/CustomerImportExport/Model/Resource/Import/CustomerComposite/Data.php @@ -37,7 +37,7 @@ public function __construct( $resourcePrefix = null, array $arguments = [] ) { - parent::__construct($resource, $coreHelper, $arguments, $resourcePrefix); + parent::__construct($resource, $coreHelper, $resourcePrefix, $arguments); if (isset($arguments['entity_type'])) { $this->_entityType = $arguments['entity_type']; diff --git a/app/code/Magento/Sales/Model/Resource/Order/Address.php b/app/code/Magento/Sales/Model/Resource/Order/Address.php index 80fc0cee41a9d..70204a2c66092 100644 --- a/app/code/Magento/Sales/Model/Resource/Order/Address.php +++ b/app/code/Magento/Sales/Model/Resource/Order/Address.php @@ -50,7 +50,7 @@ public function __construct( ) { $this->_validator = $validator; $this->gridPool = $gridPool; - parent::__construct($resource, $attribute, $salesIncrement, $gridAggregator, $resourcePrefix); + parent::__construct($resource, $attribute, $salesIncrement, $resourcePrefix, $gridAggregator); } /** diff --git a/app/code/Magento/Sales/Model/Resource/Order/Creditmemo/Comment.php b/app/code/Magento/Sales/Model/Resource/Order/Creditmemo/Comment.php index f3fc4df88b7f8..266b9c4e6fcb2 100644 --- a/app/code/Magento/Sales/Model/Resource/Order/Creditmemo/Comment.php +++ b/app/code/Magento/Sales/Model/Resource/Order/Creditmemo/Comment.php @@ -46,7 +46,7 @@ public function __construct( $resourcePrefix = null ) { $this->validator = $validator; - parent::__construct($resource, $attribute, $salesIncrement, $gridAggregator, $resourcePrefix); + parent::__construct($resource, $attribute, $salesIncrement, $resourcePrefix, $gridAggregator); } /** diff --git a/app/code/Magento/Sales/Model/Resource/Order/Shipment/Track.php b/app/code/Magento/Sales/Model/Resource/Order/Shipment/Track.php index 54e2575aa6448..b2b61445629a6 100644 --- a/app/code/Magento/Sales/Model/Resource/Order/Shipment/Track.php +++ b/app/code/Magento/Sales/Model/Resource/Order/Shipment/Track.php @@ -46,7 +46,7 @@ public function __construct( $resourcePrefix = null ) { $this->validator = $validator; - parent::__construct($resource, $attribute, $salesIncrement, $gridAggregator, $resourcePrefix); + parent::__construct($resource, $attribute, $salesIncrement, $resourcePrefix, $gridAggregator); } /** diff --git a/app/code/Magento/Sales/Model/Resource/Order/Status/History.php b/app/code/Magento/Sales/Model/Resource/Order/Status/History.php index 59433e438af96..141cba14f1dd2 100644 --- a/app/code/Magento/Sales/Model/Resource/Order/Status/History.php +++ b/app/code/Magento/Sales/Model/Resource/Order/Status/History.php @@ -38,7 +38,7 @@ public function __construct( $resourcePrefix = null ) { $this->validator = $validator; - parent::__construct($resource, $attribute, $salesIncrement, $gridAggregator, $resourcePrefix); + parent::__construct($resource, $attribute, $salesIncrement, $resourcePrefix, $gridAggregator); } /** diff --git a/dev/tests/unit/testsuite/Magento/CustomerImportExport/Model/Resource/Import/CustomerComposite/DataTest.php b/dev/tests/unit/testsuite/Magento/CustomerImportExport/Model/Resource/Import/CustomerComposite/DataTest.php index 7598086491fc3..ccb25131c0b41 100644 --- a/dev/tests/unit/testsuite/Magento/CustomerImportExport/Model/Resource/Import/CustomerComposite/DataTest.php +++ b/dev/tests/unit/testsuite/Magento/CustomerImportExport/Model/Resource/Import/CustomerComposite/DataTest.php @@ -14,6 +14,11 @@ class DataTest extends \PHPUnit_Framework_TestCase { + /** + * @var \Magento\TestFramework\Helper\ObjectManager + */ + protected $objectManager; + /** * Array of customer attributes * @@ -99,10 +104,14 @@ public function testGetNextBunch($entityType, $bunchData, $expectedData) $coreHelper = $this->getMock('Magento\Core\Helper\Data', ['__construct'], [], '', false); unset($dependencies['resource'], $dependencies['json_helper']); - $object = new Data( - $resource, - $coreHelper, - $dependencies + $this->objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); + $object = $this->objectManager->getObject( + '\Magento\CustomerImportExport\Model\Resource\Import\CustomerComposite\Data', + [ + 'resource' => $resource, + 'coreHelper' => $coreHelper, + 'arguments' => $dependencies, + ] ); $this->assertEquals($expectedData, $object->getNextBunch()); } From 3fb68729d53e89f137ab69a310b34207da110ae0 Mon Sep 17 00:00:00 2001 From: Serhiy Shkolyarenko Date: Mon, 26 Jan 2015 15:51:11 +0200 Subject: [PATCH 03/44] MAGETWO-32970: Prepare configurable connection name constructor fixes --- app/code/Magento/Sales/Model/Resource/Order/Address.php | 6 +++--- .../Magento/Sales/Model/Resource/Order/Creditmemo.php | 2 +- .../Sales/Model/Resource/Order/Creditmemo/Comment.php | 6 +++--- app/code/Magento/Sales/Model/Resource/Order/Invoice.php | 2 +- .../Sales/Model/Resource/Order/Invoice/Comment.php | 6 +++--- app/code/Magento/Sales/Model/Resource/Order/Shipment.php | 2 +- .../Sales/Model/Resource/Order/Shipment/Comment.php | 8 ++++---- .../Magento/Sales/Model/Resource/Order/Shipment/Track.php | 6 +++--- .../Magento/Sales/Model/Resource/Order/Status/History.php | 6 +++--- 9 files changed, 22 insertions(+), 22 deletions(-) diff --git a/app/code/Magento/Sales/Model/Resource/Order/Address.php b/app/code/Magento/Sales/Model/Resource/Order/Address.php index 70204a2c66092..8424cc73f2b44 100644 --- a/app/code/Magento/Sales/Model/Resource/Order/Address.php +++ b/app/code/Magento/Sales/Model/Resource/Order/Address.php @@ -36,8 +36,8 @@ class Address extends SalesResource implements OrderAddressResourceInterface * @param \Magento\Sales\Model\Increment $salesIncrement * @param \Magento\Sales\Model\Order\Address\Validator $validator * @param \Magento\Sales\Model\Resource\GridPool $gridPool - * @param \Magento\Sales\Model\Resource\GridInterface $gridAggregator * @param string|null $resourcePrefix + * @param \Magento\Sales\Model\Resource\GridInterface $gridAggregator */ public function __construct( \Magento\Framework\App\Resource $resource, @@ -45,8 +45,8 @@ public function __construct( \Magento\Sales\Model\Increment $salesIncrement, \Magento\Sales\Model\Order\Address\Validator $validator, \Magento\Sales\Model\Resource\GridPool $gridPool, - \Magento\Sales\Model\Resource\GridInterface $gridAggregator = null, - $resourcePrefix = null + $resourcePrefix = null, + \Magento\Sales\Model\Resource\GridInterface $gridAggregator = null ) { $this->_validator = $validator; $this->gridPool = $gridPool; diff --git a/app/code/Magento/Sales/Model/Resource/Order/Creditmemo.php b/app/code/Magento/Sales/Model/Resource/Order/Creditmemo.php index 861803271c429..6bcec3d9901df 100644 --- a/app/code/Magento/Sales/Model/Resource/Order/Creditmemo.php +++ b/app/code/Magento/Sales/Model/Resource/Order/Creditmemo.php @@ -52,7 +52,7 @@ public function __construct( CreditmemoGrid $gridAggregator, $resourcePrefix = null ) { - parent::__construct($resource, $attribute, $salesIncrement, $gridAggregator, $resourcePrefix); + parent::__construct($resource, $attribute, $salesIncrement, $resourcePrefix, $gridAggregator); } /** diff --git a/app/code/Magento/Sales/Model/Resource/Order/Creditmemo/Comment.php b/app/code/Magento/Sales/Model/Resource/Order/Creditmemo/Comment.php index 266b9c4e6fcb2..51d86b5b9d463 100644 --- a/app/code/Magento/Sales/Model/Resource/Order/Creditmemo/Comment.php +++ b/app/code/Magento/Sales/Model/Resource/Order/Creditmemo/Comment.php @@ -34,16 +34,16 @@ class Comment extends Entity implements CreditmemoCommentResourceInterface * @param \Magento\Sales\Model\Resource\Attribute $attribute * @param \Magento\Sales\Model\Increment $salesIncrement * @param \Magento\Sales\Model\Order\Creditmemo\Comment\Validator $validator - * @param \Magento\Sales\Model\Resource\GridInterface $gridAggregator * @param string|null $resourcePrefix + * @param \Magento\Sales\Model\Resource\GridInterface $gridAggregator */ public function __construct( \Magento\Framework\App\Resource $resource, \Magento\Sales\Model\Resource\Attribute $attribute, \Magento\Sales\Model\Increment $salesIncrement, \Magento\Sales\Model\Order\Creditmemo\Comment\Validator $validator, - \Magento\Sales\Model\Resource\GridInterface $gridAggregator = null, - $resourcePrefix = null + $resourcePrefix = null, + \Magento\Sales\Model\Resource\GridInterface $gridAggregator = null ) { $this->validator = $validator; parent::__construct($resource, $attribute, $salesIncrement, $resourcePrefix, $gridAggregator); diff --git a/app/code/Magento/Sales/Model/Resource/Order/Invoice.php b/app/code/Magento/Sales/Model/Resource/Order/Invoice.php index 928bc21d723b3..c82f05548b23c 100644 --- a/app/code/Magento/Sales/Model/Resource/Order/Invoice.php +++ b/app/code/Magento/Sales/Model/Resource/Order/Invoice.php @@ -48,7 +48,7 @@ public function __construct( InvoiceGrid $gridAggregator, $resourcePrefix = null ) { - parent::__construct($resource, $attribute, $salesIncrement, $gridAggregator, $resourcePrefix); + parent::__construct($resource, $attribute, $salesIncrement, $resourcePrefix, $gridAggregator); } /** diff --git a/app/code/Magento/Sales/Model/Resource/Order/Invoice/Comment.php b/app/code/Magento/Sales/Model/Resource/Order/Invoice/Comment.php index 8568c5728b9a7..e6a06470d8433 100644 --- a/app/code/Magento/Sales/Model/Resource/Order/Invoice/Comment.php +++ b/app/code/Magento/Sales/Model/Resource/Order/Invoice/Comment.php @@ -42,11 +42,11 @@ public function __construct( \Magento\Sales\Model\Resource\Attribute $attribute, \Magento\Sales\Model\Increment $salesIncrement, \Magento\Sales\Model\Order\Invoice\Comment\Validator $validator, - \Magento\Sales\Model\Resource\GridInterface $gridAggregator = null, - $resourcePrefix = null + $resourcePrefix = null, + \Magento\Sales\Model\Resource\GridInterface $gridAggregator = null ) { $this->validator = $validator; - parent::__construct($resource, $attribute, $salesIncrement, $gridAggregator, $resourcePrefix); + parent::__construct($resource, $attribute, $salesIncrement, $resourcePrefix, $gridAggregator); } /** diff --git a/app/code/Magento/Sales/Model/Resource/Order/Shipment.php b/app/code/Magento/Sales/Model/Resource/Order/Shipment.php index 7696cb13cae83..606fbc371ef6b 100644 --- a/app/code/Magento/Sales/Model/Resource/Order/Shipment.php +++ b/app/code/Magento/Sales/Model/Resource/Order/Shipment.php @@ -57,7 +57,7 @@ public function __construct( ShipmentGrid $gridAggregator, $resourcePrefix = null ) { - parent::__construct($resource, $attribute, $salesIncrement, $gridAggregator, $resourcePrefix); + parent::__construct($resource, $attribute, $salesIncrement, $resourcePrefix, $gridAggregator); } /** diff --git a/app/code/Magento/Sales/Model/Resource/Order/Shipment/Comment.php b/app/code/Magento/Sales/Model/Resource/Order/Shipment/Comment.php index b5ad3ad8a29a5..7cabff3207731 100644 --- a/app/code/Magento/Sales/Model/Resource/Order/Shipment/Comment.php +++ b/app/code/Magento/Sales/Model/Resource/Order/Shipment/Comment.php @@ -34,19 +34,19 @@ class Comment extends Entity implements ShipmentCommentResourceInterface * @param \Magento\Sales\Model\Resource\Attribute $attribute * @param \Magento\Sales\Model\Increment $salesIncrement * @param \Magento\Sales\Model\Order\Shipment\Comment\Validator $validator - * @param \Magento\Sales\Model\Resource\GridInterface $gridAggregator * @param string|null $resourcePrefix + * @param \Magento\Sales\Model\Resource\GridInterface $gridAggregator */ public function __construct( \Magento\Framework\App\Resource $resource, \Magento\Sales\Model\Resource\Attribute $attribute, \Magento\Sales\Model\Increment $salesIncrement, \Magento\Sales\Model\Order\Shipment\Comment\Validator $validator, - \Magento\Sales\Model\Resource\GridInterface $gridAggregator = null, - $resourcePrefix = null + $resourcePrefix = null, + \Magento\Sales\Model\Resource\GridInterface $gridAggregator = null ) { $this->validator = $validator; - parent::__construct($resource, $attribute, $salesIncrement, $gridAggregator, $resourcePrefix); + parent::__construct($resource, $attribute, $salesIncrement, $resourcePrefix, $gridAggregator); } /** diff --git a/app/code/Magento/Sales/Model/Resource/Order/Shipment/Track.php b/app/code/Magento/Sales/Model/Resource/Order/Shipment/Track.php index b2b61445629a6..0ecea1e0598d2 100644 --- a/app/code/Magento/Sales/Model/Resource/Order/Shipment/Track.php +++ b/app/code/Magento/Sales/Model/Resource/Order/Shipment/Track.php @@ -34,16 +34,16 @@ class Track extends SalesResource implements ShipmentTrackResourceInterface * @param \Magento\Sales\Model\Resource\Attribute $attribute * @param \Magento\Sales\Model\Increment $salesIncrement * @param \Magento\Sales\Model\Order\Shipment\Track\Validator $validator - * @param \Magento\Sales\Model\Resource\GridInterface $gridAggregator * @param string|null $resourcePrefix + * @param \Magento\Sales\Model\Resource\GridInterface $gridAggregator */ public function __construct( \Magento\Framework\App\Resource $resource, \Magento\Sales\Model\Resource\Attribute $attribute, \Magento\Sales\Model\Increment $salesIncrement, \Magento\Sales\Model\Order\Shipment\Track\Validator $validator, - \Magento\Sales\Model\Resource\GridInterface $gridAggregator = null, - $resourcePrefix = null + $resourcePrefix = null, + \Magento\Sales\Model\Resource\GridInterface $gridAggregator = null ) { $this->validator = $validator; parent::__construct($resource, $attribute, $salesIncrement, $resourcePrefix, $gridAggregator); diff --git a/app/code/Magento/Sales/Model/Resource/Order/Status/History.php b/app/code/Magento/Sales/Model/Resource/Order/Status/History.php index 141cba14f1dd2..d2d075a0e94d8 100644 --- a/app/code/Magento/Sales/Model/Resource/Order/Status/History.php +++ b/app/code/Magento/Sales/Model/Resource/Order/Status/History.php @@ -26,16 +26,16 @@ class History extends Entity implements OrderStatusHistoryResourceInterface * @param \Magento\Sales\Model\Resource\Attribute $attribute * @param \Magento\Sales\Model\Increment $salesIncrement * @param Validator $validator - * @param \Magento\Sales\Model\Resource\GridInterface $gridAggregator * @param string|null $resourcePrefix + * @param \Magento\Sales\Model\Resource\GridInterface $gridAggregator */ public function __construct( \Magento\Framework\App\Resource $resource, \Magento\Sales\Model\Resource\Attribute $attribute, \Magento\Sales\Model\Increment $salesIncrement, Validator $validator, - \Magento\Sales\Model\Resource\GridInterface $gridAggregator = null, - $resourcePrefix = null + $resourcePrefix = null, + \Magento\Sales\Model\Resource\GridInterface $gridAggregator = null ) { $this->validator = $validator; parent::__construct($resource, $attribute, $salesIncrement, $resourcePrefix, $gridAggregator); From 36bcf8b1df1e195910e7fc567cdcc982e1ceb3e4 Mon Sep 17 00:00:00 2001 From: Serhiy Shkolyarenko Date: Mon, 26 Jan 2015 16:03:03 +0200 Subject: [PATCH 04/44] MAGETWO-32970: Prepare configurable connection name static test fixes --- .../Catalog/Model/Resource/Product/Indexer/Eav/Source.php | 1 + app/code/Magento/CatalogSearch/Model/Resource/Engine.php | 3 +++ app/code/Magento/Review/Model/Resource/Review.php | 2 +- app/code/Magento/Sales/Model/Resource/Report/Bestsellers.php | 1 + app/code/Magento/Sales/Model/Resource/Report/Order.php | 3 ++- app/code/Magento/Sitemap/Model/Resource/Catalog/Product.php | 1 + 6 files changed, 9 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Catalog/Model/Resource/Product/Indexer/Eav/Source.php b/app/code/Magento/Catalog/Model/Resource/Product/Indexer/Eav/Source.php index e5bb97afc817d..68b3acee57dcd 100644 --- a/app/code/Magento/Catalog/Model/Resource/Product/Indexer/Eav/Source.php +++ b/app/code/Magento/Catalog/Model/Resource/Product/Indexer/Eav/Source.php @@ -317,6 +317,7 @@ protected function _saveIndexData(array $data) * * @param string|null $table * @return string + * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function getIdxTable($table = null) { diff --git a/app/code/Magento/CatalogSearch/Model/Resource/Engine.php b/app/code/Magento/CatalogSearch/Model/Resource/Engine.php index c916869ba874d..4cf9f59e43411 100644 --- a/app/code/Magento/CatalogSearch/Model/Resource/Engine.php +++ b/app/code/Magento/CatalogSearch/Model/Resource/Engine.php @@ -111,6 +111,7 @@ protected function _construct() * @param array $index * @param string $entity 'product'|'cms' * @return $this + * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function saveEntityIndex($entityId, $storeId, $index, $entity = 'product') { @@ -130,6 +131,7 @@ public function saveEntityIndex($entityId, $storeId, $index, $entity = 'product' * @param array $entityIndexes * @param string $entity 'product'|'cms' * @return $this + * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function saveEntityIndexes($storeId, $entityIndexes, $entity = 'product') { @@ -213,6 +215,7 @@ public function processAttributeValue($attribute, $value) * @param int $entityId * @param string $entity 'product'|'cms' * @return $this + * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function cleanIndex($storeId = null, $entityId = null, $entity = 'product') { diff --git a/app/code/Magento/Review/Model/Resource/Review.php b/app/code/Magento/Review/Model/Resource/Review.php index 1e7c09e92f6c5..748740826fb9b 100644 --- a/app/code/Magento/Review/Model/Resource/Review.php +++ b/app/code/Magento/Review/Model/Resource/Review.php @@ -95,7 +95,7 @@ class Review extends \Magento\Framework\Model\Resource\Db\AbstractDb * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Review\Model\RatingFactory $ratingFactory * @param \Magento\Review\Model\Resource\Rating\Option $ratingOptions - * * @param string|null $resourcePrefix + * @param string|null $resourcePrefix */ public function __construct( \Magento\Framework\App\Resource $resource, diff --git a/app/code/Magento/Sales/Model/Resource/Report/Bestsellers.php b/app/code/Magento/Sales/Model/Resource/Report/Bestsellers.php index 5ff3518c10409..73ccd7f70c9e3 100644 --- a/app/code/Magento/Sales/Model/Resource/Report/Bestsellers.php +++ b/app/code/Magento/Sales/Model/Resource/Report/Bestsellers.php @@ -47,6 +47,7 @@ class Bestsellers extends AbstractReport * @param \Magento\Sales\Model\Resource\Helper $salesResourceHelper * @param array $ignoredProductTypes * @param string|null $resourcePrefix + * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( \Magento\Framework\App\Resource $resource, diff --git a/app/code/Magento/Sales/Model/Resource/Report/Order.php b/app/code/Magento/Sales/Model/Resource/Report/Order.php index 6f95d746efaf6..af049956e3d5e 100644 --- a/app/code/Magento/Sales/Model/Resource/Report/Order.php +++ b/app/code/Magento/Sales/Model/Resource/Report/Order.php @@ -42,7 +42,8 @@ public function __construct( \Magento\Sales\Model\Resource\Report\Order\UpdatedatFactory $updateDatFactory, $resourcePrefix = null ) { - parent::__construct($resource, + parent::__construct( + $resource, $logger, $localeDate, $reportsFlagFactory, diff --git a/app/code/Magento/Sitemap/Model/Resource/Catalog/Product.php b/app/code/Magento/Sitemap/Model/Resource/Catalog/Product.php index f630ebb0add73..e1ad85c1dfcf5 100644 --- a/app/code/Magento/Sitemap/Model/Resource/Catalog/Product.php +++ b/app/code/Magento/Sitemap/Model/Resource/Catalog/Product.php @@ -93,6 +93,7 @@ class Product extends \Magento\Framework\Model\Resource\Db\AbstractDb * @param \Magento\Eav\Model\ConfigFactory $eavConfigFactory * @param \Magento\Catalog\Model\Product\Media\Config $mediaConfig * @param string|null $resourcePrefix + * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( \Magento\Framework\App\Resource $resource, From 731dba17cb215996be298274f62a26bd2f0fb0a3 Mon Sep 17 00:00:00 2001 From: Serhiy Shkolyarenko Date: Mon, 2 Feb 2015 18:01:15 +0200 Subject: [PATCH 05/44] MAGETWO-32970: Prepare configurable connection name added resource config --- app/code/Magento/Sales/etc/resources.xml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 app/code/Magento/Sales/etc/resources.xml diff --git a/app/code/Magento/Sales/etc/resources.xml b/app/code/Magento/Sales/etc/resources.xml new file mode 100644 index 0000000000000..bfdaa140596a3 --- /dev/null +++ b/app/code/Magento/Sales/etc/resources.xml @@ -0,0 +1,11 @@ + + + + + + + From 304915316f3a9d006c7959ceaca3605d5e9b2219 Mon Sep 17 00:00:00 2001 From: Serhiy Shkolyarenko Date: Tue, 3 Feb 2015 13:06:24 +0200 Subject: [PATCH 06/44] MAGETWO-32970: Prepare configurable connection name moved resource config to Quote module --- app/code/Magento/{Sales => Quote}/etc/resources.xml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename app/code/Magento/{Sales => Quote}/etc/resources.xml (100%) diff --git a/app/code/Magento/Sales/etc/resources.xml b/app/code/Magento/Quote/etc/resources.xml similarity index 100% rename from app/code/Magento/Sales/etc/resources.xml rename to app/code/Magento/Quote/etc/resources.xml From f4a7d604ea38af89bee910102aec6f7a129adc58 Mon Sep 17 00:00:00 2001 From: Serhiy Shkolyarenko Date: Tue, 3 Feb 2015 20:21:15 +0200 Subject: [PATCH 07/44] MAGETWO-32970: Prepare configurable connection name fixed connection name --- app/code/Magento/Quote/etc/resources.xml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Quote/etc/resources.xml b/app/code/Magento/Quote/etc/resources.xml index bfdaa140596a3..9db2e0bbfd1e7 100644 --- a/app/code/Magento/Quote/etc/resources.xml +++ b/app/code/Magento/Quote/etc/resources.xml @@ -1,11 +1,12 @@ - + From 7978f1feb5b89803ba012f702b20b021b64c992b Mon Sep 17 00:00:00 2001 From: Olexii Korshenko Date: Thu, 5 Feb 2015 12:43:52 +0200 Subject: [PATCH 08/44] MAGETWO-32974: DB Foreign Keys Management on the Application Level --- app/etc/di.xml | 2 + .../Model/Resource/Db/AbstractDb.php | 17 +++++-- .../Resource/Db/ObjectRelationProcessor.php | 50 +++++++++++++++++++ .../Db/ObjectRelationProcessorInterface.php | 45 +++++++++++++++++ 4 files changed, 109 insertions(+), 5 deletions(-) create mode 100644 lib/internal/Magento/Framework/Model/Resource/Db/ObjectRelationProcessor.php create mode 100644 lib/internal/Magento/Framework/Model/Resource/Db/ObjectRelationProcessorInterface.php diff --git a/app/etc/di.xml b/app/etc/di.xml index af058c9dc4aaf..7808df1581a37 100644 --- a/app/etc/di.xml +++ b/app/etc/di.xml @@ -87,6 +87,8 @@ + + Magento\Framework\Filesystem\Driver\File diff --git a/lib/internal/Magento/Framework/Model/Resource/Db/AbstractDb.php b/lib/internal/Magento/Framework/Model/Resource/Db/AbstractDb.php index e61f60533d5e6..956b054a2adb5 100644 --- a/lib/internal/Magento/Framework/Model/Resource/Db/AbstractDb.php +++ b/lib/internal/Magento/Framework/Model/Resource/Db/AbstractDb.php @@ -115,6 +115,11 @@ abstract class AbstractDb extends \Magento\Framework\Model\Resource\AbstractReso */ protected $_serializableFields = []; + /** + * @var ObjectRelationProcessorInterface + */ + protected $relationProcessor; + /** * Class constructor * @@ -457,22 +462,24 @@ public function save(\Magento\Framework\Model\AbstractModel $object) */ public function delete(\Magento\Framework\Model\AbstractModel $object) { - $this->beginTransaction(); + $this->relationProcessor->beginTransaction($this->_getWriteAdapter()); try { $object->beforeDelete(); $this->_beforeDelete($object); - $this->_getWriteAdapter()->delete( + $this->relationProcessor->delete( + $this->_getWriteAdapter(), $this->getMainTable(), - $this->_getWriteAdapter()->quoteInto($this->getIdFieldName() . '=?', $object->getId()) + $this->_getWriteAdapter()->quoteInto($this->getIdFieldName() . '=?', $object->getId()), + $object->getData() ); $this->_afterDelete($object); $object->isDeleted(true); $object->afterDelete(); - $this->commit(); + $this->relationProcessor->commit(); $object->afterDeleteCommit(); } catch (\Exception $e) { - $this->rollBack(); + $this->relationProcessor->rollBack(); throw $e; } return $this; diff --git a/lib/internal/Magento/Framework/Model/Resource/Db/ObjectRelationProcessor.php b/lib/internal/Magento/Framework/Model/Resource/Db/ObjectRelationProcessor.php new file mode 100644 index 0000000000000..32d3227c535e4 --- /dev/null +++ b/lib/internal/Magento/Framework/Model/Resource/Db/ObjectRelationProcessor.php @@ -0,0 +1,50 @@ +delete($table, $condition); + } + + /** + * {@inheritdoc} + */ + public function beginTransaction(Connection $connection) + { + $this->connection = $connection; + $this->connection->beginTransaction(); + } + + /** + * {@inheritdoc} + */ + public function commit() + { + $this->connection->commit(); + } + + /** + * {@inheritdoc} + */ + public function rollBack() + { + $this->connection->rollBack(); + } +} diff --git a/lib/internal/Magento/Framework/Model/Resource/Db/ObjectRelationProcessorInterface.php b/lib/internal/Magento/Framework/Model/Resource/Db/ObjectRelationProcessorInterface.php new file mode 100644 index 0000000000000..35713e940cfcc --- /dev/null +++ b/lib/internal/Magento/Framework/Model/Resource/Db/ObjectRelationProcessorInterface.php @@ -0,0 +1,45 @@ + Date: Thu, 5 Feb 2015 15:59:51 +0200 Subject: [PATCH 09/44] MAGETWO-33650: Validation of Constraint before Model Save --- .../Resource/Db/ObjectRelationProcessorInterface.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/internal/Magento/Framework/Model/Resource/Db/ObjectRelationProcessorInterface.php b/lib/internal/Magento/Framework/Model/Resource/Db/ObjectRelationProcessorInterface.php index 35713e940cfcc..43d0b4519e6e1 100644 --- a/lib/internal/Magento/Framework/Model/Resource/Db/ObjectRelationProcessorInterface.php +++ b/lib/internal/Magento/Framework/Model/Resource/Db/ObjectRelationProcessorInterface.php @@ -21,6 +21,16 @@ interface ObjectRelationProcessorInterface */ public function delete(Connection $connection, $table, $condition, array $involvedData); + /** + * Validate data that is about to be saved. Check that referenced entity(s) exists. + * + * @param string $table + * @param array $involvedData + * @return void + * @throws \LogicException + */ + public function validate($table, array $involvedData); + /** * Start transaction * From f90358902d1cafc71ccd3e9590ce9742661fb08d Mon Sep 17 00:00:00 2001 From: Olexii Korshenko Date: Thu, 5 Feb 2015 17:40:14 +0200 Subject: [PATCH 10/44] MAGETWO-32974: DB Foreign Keys Management on the Application Level - injected object relation processor to class constructors --- .../Resource/Product/Indexer/AbstractIndexer.php | 10 +++++++--- .../Resource/Product/Indexer/Eav/AbstractEav.php | 4 +++- .../Model/Resource/Product/Indexer/Eav/Source.php | 4 +++- .../Resource/Product/Indexer/Price/DefaultPrice.php | 4 +++- .../Magento/Catalog/Model/Resource/Product/Link.php | 10 +++++++--- .../Catalog/Model/Resource/Product/Option.php | 4 +++- .../Catalog/Model/Resource/Product/Option/Value.php | 4 +++- .../Catalog/Model/Resource/Product/Website.php | 4 +++- app/code/Magento/Catalog/Model/Resource/Url.php | 4 +++- .../CheckoutAgreements/Model/Resource/Agreement.php | 10 +++++++--- app/code/Magento/Cms/Model/Resource/Block.php | 4 +++- app/code/Magento/Cms/Model/Resource/Page.php | 4 +++- .../Model/Resource/Product/Type/Configurable.php | 4 +++- .../Product/Type/Configurable/Attribute.php | 4 +++- .../Core/Model/Resource/File/Storage/Database.php | 10 +++++++--- .../Magento/Core/Model/Resource/Layout/Update.php | 10 +++++++--- app/code/Magento/Customer/Model/Resource/Group.php | 4 +++- .../Magento/Customer/Model/Resource/Visitor.php | 4 +++- .../Resource/Import/CustomerComposite/Data.php | 4 +++- .../DesignEditor/Model/Theme/Resource/Change.php | 10 +++++++--- .../Magento/Directory/Model/Resource/Region.php | 10 +++++++--- .../Magento/Downloadable/Model/Resource/Link.php | 4 +++- .../Magento/Eav/Model/Resource/Entity/Attribute.php | 4 +++- .../Eav/Model/Resource/Entity/Attribute/Set.php | 4 +++- app/code/Magento/Email/Model/Resource/Template.php | 10 +++++++--- .../ImportExport/Model/Resource/Import/Data.php | 4 +++- .../Integration/Model/Resource/Oauth/Consumer.php | 10 +++++++--- .../Integration/Model/Resource/Oauth/Token.php | 10 +++++++--- app/code/Magento/Log/Model/Resource/Log.php | 4 +++- app/code/Magento/Log/Model/Resource/Visitor.php | 4 +++- .../Magento/Log/Model/Resource/Visitor/Online.php | 10 +++++++--- .../Magento/Newsletter/Model/Resource/Queue.php | 4 +++- .../Newsletter/Model/Resource/Subscriber.php | 4 +++- .../Magento/Newsletter/Model/Resource/Template.php | 10 +++++++--- .../Model/Resource/Carrier/Tablerate.php | 4 +++- .../Magento/Persistent/Model/Resource/Session.php | 4 +++- .../Magento/ProductAlert/Model/Resource/Price.php | 10 +++++++--- .../Magento/ProductAlert/Model/Resource/Stock.php | 10 +++++++--- app/code/Magento/Quote/Model/Resource/Quote.php | 4 +++- .../Magento/Quote/Model/Resource/Quote/Payment.php | 9 --------- app/code/Magento/Reports/Model/Resource/Event.php | 4 +++- .../Model/Resource/Product/Index/AbstractIndex.php | 4 +++- .../Model/Resource/Report/AbstractReport.php | 4 +++- .../Model/Resource/Report/Product/Viewed.php | 12 +++++++++++- app/code/Magento/Review/Model/Resource/Rating.php | 4 +++- .../Magento/Review/Model/Resource/Rating/Option.php | 4 +++- app/code/Magento/Review/Model/Resource/Review.php | 4 +++- .../Magento/Sales/Model/Resource/AbstractGrid.php | 9 ++++++--- app/code/Magento/Sales/Model/Resource/Entity.php | 4 +++- app/code/Magento/Sales/Model/Resource/Order.php | 4 +++- .../Magento/Sales/Model/Resource/Order/Address.php | 4 +++- .../Sales/Model/Resource/Order/Creditmemo.php | 4 +++- .../Model/Resource/Order/Creditmemo/Comment.php | 4 +++- .../Magento/Sales/Model/Resource/Order/Invoice.php | 4 +++- .../Sales/Model/Resource/Order/Invoice/Comment.php | 4 +++- .../Magento/Sales/Model/Resource/Order/Shipment.php | 4 +++- .../Sales/Model/Resource/Order/Shipment/Comment.php | 4 +++- .../Sales/Model/Resource/Order/Shipment/Track.php | 4 +++- .../Magento/Sales/Model/Resource/Order/Status.php | 4 +++- .../Sales/Model/Resource/Order/Status/History.php | 4 +++- .../Sales/Model/Resource/Report/Bestsellers.php | 12 +++++++++++- .../Magento/Sales/Model/Resource/Report/Order.php | 12 +++++++++++- .../SalesRule/Model/Resource/Report/Rule.php | 12 +++++++++++- app/code/Magento/SalesRule/Model/Resource/Rule.php | 4 +++- app/code/Magento/Search/Model/Resource/Query.php | 4 +++- .../Sitemap/Model/Resource/Catalog/Category.php | 4 +++- .../Sitemap/Model/Resource/Catalog/Product.php | 4 +++- app/code/Magento/Tax/Model/Resource/Calculation.php | 4 +++- app/code/Magento/Tax/Model/Resource/Report/Tax.php | 12 +++++++++++- app/code/Magento/Theme/Model/Resource/Design.php | 10 +++++++--- .../Magento/Translation/Model/Resource/String.php | 4 +++- .../Translation/Model/Resource/Translate.php | 4 +++- app/code/Magento/User/Model/Resource/User.php | 4 +++- .../Model/Resource/Attribute/Backend/Weee/Tax.php | 4 +++- app/code/Magento/Weee/Model/Resource/Tax.php | 10 +++++++--- .../Framework/Model/Resource/Db/AbstractDb.php | 7 +++++-- .../Model/Resource/Db/ObjectRelationProcessor.php | 13 +++++++++++++ 77 files changed, 347 insertions(+), 119 deletions(-) diff --git a/app/code/Magento/Catalog/Model/Resource/Product/Indexer/AbstractIndexer.php b/app/code/Magento/Catalog/Model/Resource/Product/Indexer/AbstractIndexer.php index a360808a064a7..9177e9609f63f 100644 --- a/app/code/Magento/Catalog/Model/Resource/Product/Indexer/AbstractIndexer.php +++ b/app/code/Magento/Catalog/Model/Resource/Product/Indexer/AbstractIndexer.php @@ -23,12 +23,16 @@ abstract class AbstractIndexer extends \Magento\Indexer\Model\Resource\AbstractR * Class constructor * * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param \Magento\Eav\Model\Config $eavConfig */ - public function __construct(\Magento\Framework\App\Resource $resource, \Magento\Eav\Model\Config $eavConfig) - { + public function __construct( + \Magento\Framework\App\Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Eav\Model\Config $eavConfig + ) { $this->_eavConfig = $eavConfig; - parent::__construct($resource); + parent::__construct($resource, $objectRelationProcessor); } /** diff --git a/app/code/Magento/Catalog/Model/Resource/Product/Indexer/Eav/AbstractEav.php b/app/code/Magento/Catalog/Model/Resource/Product/Indexer/Eav/AbstractEav.php index 6b407d98eb19a..afb3b52ef53ae 100644 --- a/app/code/Magento/Catalog/Model/Resource/Product/Indexer/Eav/AbstractEav.php +++ b/app/code/Magento/Catalog/Model/Resource/Product/Indexer/Eav/AbstractEav.php @@ -23,16 +23,18 @@ abstract class AbstractEav extends \Magento\Catalog\Model\Resource\Product\Index * Construct * * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\Framework\Event\ManagerInterface $eventManager */ public function __construct( \Magento\Framework\App\Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, \Magento\Eav\Model\Config $eavConfig, \Magento\Framework\Event\ManagerInterface $eventManager ) { $this->_eventManager = $eventManager; - parent::__construct($resource, $eavConfig); + parent::__construct($resource, $objectRelationProcessor, $eavConfig); } /** diff --git a/app/code/Magento/Catalog/Model/Resource/Product/Indexer/Eav/Source.php b/app/code/Magento/Catalog/Model/Resource/Product/Indexer/Eav/Source.php index a6ffee370583b..6fa2a1df54f7d 100644 --- a/app/code/Magento/Catalog/Model/Resource/Product/Indexer/Eav/Source.php +++ b/app/code/Magento/Catalog/Model/Resource/Product/Indexer/Eav/Source.php @@ -25,18 +25,20 @@ class Source extends AbstractEav * Construct * * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Catalog\Model\Resource\Helper $resourceHelper */ public function __construct( \Magento\Framework\App\Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, \Magento\Eav\Model\Config $eavConfig, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Catalog\Model\Resource\Helper $resourceHelper ) { $this->_resourceHelper = $resourceHelper; - parent::__construct($resource, $eavConfig, $eventManager); + parent::__construct($resource, $objectRelationProcessor, $eavConfig, $eventManager); } /** diff --git a/app/code/Magento/Catalog/Model/Resource/Product/Indexer/Price/DefaultPrice.php b/app/code/Magento/Catalog/Model/Resource/Product/Indexer/Price/DefaultPrice.php index bc256d7ee3426..07f5816509cd1 100644 --- a/app/code/Magento/Catalog/Model/Resource/Product/Indexer/Price/DefaultPrice.php +++ b/app/code/Magento/Catalog/Model/Resource/Product/Indexer/Price/DefaultPrice.php @@ -43,19 +43,21 @@ class DefaultPrice extends \Magento\Catalog\Model\Resource\Product\Indexer\Abstr /** * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Framework\Module\Manager $moduleManager */ public function __construct( \Magento\Framework\App\Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, \Magento\Eav\Model\Config $eavConfig, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Framework\Module\Manager $moduleManager ) { $this->_eventManager = $eventManager; $this->moduleManager = $moduleManager; - parent::__construct($resource, $eavConfig); + parent::__construct($resource, $objectRelationProcessor, $eavConfig); } /** diff --git a/app/code/Magento/Catalog/Model/Resource/Product/Link.php b/app/code/Magento/Catalog/Model/Resource/Product/Link.php index cb70baff0420b..f2c090429e2da 100644 --- a/app/code/Magento/Catalog/Model/Resource/Product/Link.php +++ b/app/code/Magento/Catalog/Model/Resource/Product/Link.php @@ -28,12 +28,16 @@ class Link extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param Relation $catalogProductRelation */ - public function __construct(\Magento\Framework\App\Resource $resource, Relation $catalogProductRelation) - { + public function __construct( + \Magento\Framework\App\Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + Relation $catalogProductRelation + ) { $this->_catalogProductRelation = $catalogProductRelation; - parent::__construct($resource); + parent::__construct($resource, $objectRelationProcessor); } /** diff --git a/app/code/Magento/Catalog/Model/Resource/Product/Option.php b/app/code/Magento/Catalog/Model/Resource/Product/Option.php index 1e3882df9ae61..f3cbb1c7acd9f 100644 --- a/app/code/Magento/Catalog/Model/Resource/Product/Option.php +++ b/app/code/Magento/Catalog/Model/Resource/Product/Option.php @@ -37,12 +37,14 @@ class Option extends \Magento\Framework\Model\Resource\Db\AbstractDb * Class constructor * * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param \Magento\Directory\Model\CurrencyFactory $currencyFactory * @param \Magento\Framework\Store\StoreManagerInterface $storeManager * @param \Magento\Framework\App\Config\ScopeConfigInterface $config */ public function __construct( \Magento\Framework\App\Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, \Magento\Directory\Model\CurrencyFactory $currencyFactory, \Magento\Framework\Store\StoreManagerInterface $storeManager, \Magento\Framework\App\Config\ScopeConfigInterface $config @@ -50,7 +52,7 @@ public function __construct( $this->_currencyFactory = $currencyFactory; $this->_storeManager = $storeManager; $this->_config = $config; - parent::__construct($resource); + parent::__construct($resource, $objectRelationProcessor); } /** diff --git a/app/code/Magento/Catalog/Model/Resource/Product/Option/Value.php b/app/code/Magento/Catalog/Model/Resource/Product/Option/Value.php index 89a1dba13bc49..c79fac807026a 100644 --- a/app/code/Magento/Catalog/Model/Resource/Product/Option/Value.php +++ b/app/code/Magento/Catalog/Model/Resource/Product/Option/Value.php @@ -37,12 +37,14 @@ class Value extends \Magento\Framework\Model\Resource\Db\AbstractDb * Class constructor * * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param \Magento\Directory\Model\CurrencyFactory $currencyFactory * @param \Magento\Framework\Store\StoreManagerInterface $storeManager * @param \Magento\Framework\App\Config\ScopeConfigInterface $config */ public function __construct( \Magento\Framework\App\Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, \Magento\Directory\Model\CurrencyFactory $currencyFactory, \Magento\Framework\Store\StoreManagerInterface $storeManager, \Magento\Framework\App\Config\ScopeConfigInterface $config @@ -50,7 +52,7 @@ public function __construct( $this->_currencyFactory = $currencyFactory; $this->_storeManager = $storeManager; $this->_config = $config; - parent::__construct($resource); + parent::__construct($resource, $objectRelationProcessor); } /** diff --git a/app/code/Magento/Catalog/Model/Resource/Product/Website.php b/app/code/Magento/Catalog/Model/Resource/Product/Website.php index f73573e2e5074..6bd4c53ee2c82 100644 --- a/app/code/Magento/Catalog/Model/Resource/Product/Website.php +++ b/app/code/Magento/Catalog/Model/Resource/Product/Website.php @@ -19,14 +19,16 @@ class Website extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param \Magento\Framework\Store\StoreManagerInterface $storeManager */ public function __construct( \Magento\Framework\App\Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, \Magento\Framework\Store\StoreManagerInterface $storeManager ) { $this->_storeManager = $storeManager; - parent::__construct($resource); + parent::__construct($resource, $objectRelationProcessor); } /** diff --git a/app/code/Magento/Catalog/Model/Resource/Url.php b/app/code/Magento/Catalog/Model/Resource/Url.php index 8bbcdb9f5adb2..b5525addb27dd 100644 --- a/app/code/Magento/Catalog/Model/Resource/Url.php +++ b/app/code/Magento/Catalog/Model/Resource/Url.php @@ -89,6 +89,7 @@ class Url extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param \Magento\Framework\Store\StoreManagerInterface $storeManager * @param \Magento\Eav\Model\Config $eavConfig * @param Product $productResource @@ -97,6 +98,7 @@ class Url extends \Magento\Framework\Model\Resource\Db\AbstractDb */ public function __construct( \Magento\Framework\App\Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, \Magento\Framework\Store\StoreManagerInterface $storeManager, \Magento\Eav\Model\Config $eavConfig, Product $productResource, @@ -108,7 +110,7 @@ public function __construct( $this->productResource = $productResource; $this->_catalogCategory = $catalogCategory; $this->_logger = $logger; - parent::__construct($resource); + parent::__construct($resource, $objectRelationProcessor); } /** diff --git a/app/code/Magento/CheckoutAgreements/Model/Resource/Agreement.php b/app/code/Magento/CheckoutAgreements/Model/Resource/Agreement.php index 943e6738e9e67..32a36645d5bd8 100644 --- a/app/code/Magento/CheckoutAgreements/Model/Resource/Agreement.php +++ b/app/code/Magento/CheckoutAgreements/Model/Resource/Agreement.php @@ -20,12 +20,16 @@ class Agreement extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param \Magento\Framework\Filter\FilterManager $filterManager */ - public function __construct(\Magento\Framework\App\Resource $resource, \Magento\Framework\Filter\FilterManager $filterManager) - { + public function __construct( + \Magento\Framework\App\Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Filter\FilterManager $filterManager + ) { $this->filterManager = $filterManager; - parent::__construct($resource); + parent::__construct($resource, $objectRelationProcessor); } /** diff --git a/app/code/Magento/Cms/Model/Resource/Block.php b/app/code/Magento/Cms/Model/Resource/Block.php index 2b15dcaa243f4..ca71333ef91d8 100644 --- a/app/code/Magento/Cms/Model/Resource/Block.php +++ b/app/code/Magento/Cms/Model/Resource/Block.php @@ -26,15 +26,17 @@ class Block extends \Magento\Framework\Model\Resource\Db\AbstractDb * Construct * * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param \Magento\Framework\Stdlib\DateTime\DateTime $date * @param \Magento\Framework\Store\StoreManagerInterface $storeManager */ public function __construct( \Magento\Framework\App\Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, \Magento\Framework\Stdlib\DateTime\DateTime $date, \Magento\Framework\Store\StoreManagerInterface $storeManager ) { - parent::__construct($resource); + parent::__construct($resource, $objectRelationProcessor); $this->_storeManager = $storeManager; $this->_date = $date; } diff --git a/app/code/Magento/Cms/Model/Resource/Page.php b/app/code/Magento/Cms/Model/Resource/Page.php index b5af42c81c334..08e4b1fcbe3ed 100644 --- a/app/code/Magento/Cms/Model/Resource/Page.php +++ b/app/code/Magento/Cms/Model/Resource/Page.php @@ -41,17 +41,19 @@ class Page extends \Magento\Framework\Model\Resource\Db\AbstractDb * Construct * * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param \Magento\Framework\Stdlib\DateTime\DateTime $date * @param \Magento\Framework\Store\StoreManagerInterface $storeManager * @param \Magento\Framework\Stdlib\DateTime $dateTime */ public function __construct( \Magento\Framework\App\Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, \Magento\Framework\Stdlib\DateTime\DateTime $date, \Magento\Framework\Store\StoreManagerInterface $storeManager, \Magento\Framework\Stdlib\DateTime $dateTime ) { - parent::__construct($resource); + parent::__construct($resource, $objectRelationProcessor); $this->_date = $date; $this->_storeManager = $storeManager; $this->dateTime = $dateTime; diff --git a/app/code/Magento/ConfigurableProduct/Model/Resource/Product/Type/Configurable.php b/app/code/Magento/ConfigurableProduct/Model/Resource/Product/Type/Configurable.php index aba00204d0fe1..068a02425db49 100644 --- a/app/code/Magento/ConfigurableProduct/Model/Resource/Product/Type/Configurable.php +++ b/app/code/Magento/ConfigurableProduct/Model/Resource/Product/Type/Configurable.php @@ -18,14 +18,16 @@ class Configurable extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param \Magento\Catalog\Model\Resource\Product\Relation $catalogProductRelation */ public function __construct( \Magento\Framework\App\Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, \Magento\Catalog\Model\Resource\Product\Relation $catalogProductRelation ) { $this->_catalogProductRelation = $catalogProductRelation; - parent::__construct($resource); + parent::__construct($resource, $objectRelationProcessor); } /** diff --git a/app/code/Magento/ConfigurableProduct/Model/Resource/Product/Type/Configurable/Attribute.php b/app/code/Magento/ConfigurableProduct/Model/Resource/Product/Type/Configurable/Attribute.php index d03d2dd89ae02..5382a16fa4057 100644 --- a/app/code/Magento/ConfigurableProduct/Model/Resource/Product/Type/Configurable/Attribute.php +++ b/app/code/Magento/ConfigurableProduct/Model/Resource/Product/Type/Configurable/Attribute.php @@ -41,17 +41,19 @@ class Attribute extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param \Magento\Framework\Store\StoreManagerInterface $storeManager * @param \Magento\Catalog\Helper\Data $catalogData */ public function __construct( \Magento\Framework\App\Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, \Magento\Framework\Store\StoreManagerInterface $storeManager, \Magento\Catalog\Helper\Data $catalogData ) { $this->_storeManager = $storeManager; $this->_catalogData = $catalogData; - parent::__construct($resource); + parent::__construct($resource, $objectRelationProcessor); } /** diff --git a/app/code/Magento/Core/Model/Resource/File/Storage/Database.php b/app/code/Magento/Core/Model/Resource/File/Storage/Database.php index ac9cb6e3450eb..90c0aa8642405 100644 --- a/app/code/Magento/Core/Model/Resource/File/Storage/Database.php +++ b/app/code/Magento/Core/Model/Resource/File/Storage/Database.php @@ -17,11 +17,15 @@ class Database extends \Magento\Core\Model\Resource\File\Storage\AbstractStorage /** * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param \Magento\Framework\DB\Helper $resourceHelper */ - public function __construct(\Magento\Framework\App\Resource $resource, \Magento\Framework\DB\Helper $resourceHelper) - { - parent::__construct($resource); + public function __construct( + \Magento\Framework\App\Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\DB\Helper $resourceHelper + ) { + parent::__construct($resource, $objectRelationProcessor); $this->_resourceHelper = $resourceHelper; } diff --git a/app/code/Magento/Core/Model/Resource/Layout/Update.php b/app/code/Magento/Core/Model/Resource/Layout/Update.php index 00d3e0eff8281..2ab68502df1d2 100644 --- a/app/code/Magento/Core/Model/Resource/Layout/Update.php +++ b/app/code/Magento/Core/Model/Resource/Layout/Update.php @@ -20,11 +20,15 @@ class Update extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param \Magento\Framework\Cache\FrontendInterface $cache */ - public function __construct(\Magento\Framework\App\Resource $resource, \Magento\Framework\Cache\FrontendInterface $cache) - { - parent::__construct($resource); + public function __construct( + \Magento\Framework\App\Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Cache\FrontendInterface $cache + ) { + parent::__construct($resource, $objectRelationProcessor); $this->_cache = $cache; } diff --git a/app/code/Magento/Customer/Model/Resource/Group.php b/app/code/Magento/Customer/Model/Resource/Group.php index 53adec297113b..a6a293fa0c027 100644 --- a/app/code/Magento/Customer/Model/Resource/Group.php +++ b/app/code/Magento/Customer/Model/Resource/Group.php @@ -26,17 +26,19 @@ class Group extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param \Magento\Customer\Api\GroupManagementInterface $groupManagement * @param Customer\CollectionFactory $customersFactory */ public function __construct( \Magento\Framework\App\Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, \Magento\Customer\Api\GroupManagementInterface $groupManagement, \Magento\Customer\Model\Resource\Customer\CollectionFactory $customersFactory ) { $this->_groupManagement = $groupManagement; $this->_customersFactory = $customersFactory; - parent::__construct($resource); + parent::__construct($resource, $objectRelationProcessor); } /** diff --git a/app/code/Magento/Customer/Model/Resource/Visitor.php b/app/code/Magento/Customer/Model/Resource/Visitor.php index db568a76dbe9e..51c806ce8d1d5 100644 --- a/app/code/Magento/Customer/Model/Resource/Visitor.php +++ b/app/code/Magento/Customer/Model/Resource/Visitor.php @@ -24,17 +24,19 @@ class Visitor extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param \Magento\Framework\Stdlib\DateTime\DateTime $date * @param \Magento\Framework\Stdlib\DateTime $dateTime */ public function __construct( \Magento\Framework\App\Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, \Magento\Framework\Stdlib\DateTime\DateTime $date, \Magento\Framework\Stdlib\DateTime $dateTime ) { $this->date = $date; $this->dateTime = $dateTime; - parent::__construct($resource); + parent::__construct($resource, $objectRelationProcessor); } /** diff --git a/app/code/Magento/CustomerImportExport/Model/Resource/Import/CustomerComposite/Data.php b/app/code/Magento/CustomerImportExport/Model/Resource/Import/CustomerComposite/Data.php index 422c51e343518..6ea78c8123dc0 100644 --- a/app/code/Magento/CustomerImportExport/Model/Resource/Import/CustomerComposite/Data.php +++ b/app/code/Magento/CustomerImportExport/Model/Resource/Import/CustomerComposite/Data.php @@ -27,15 +27,17 @@ class Data extends \Magento\ImportExport\Model\Resource\Import\Data * Class constructor * * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param \Magento\Core\Helper\Data $coreHelper * @param array $arguments */ public function __construct( \Magento\Framework\App\Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, \Magento\Core\Helper\Data $coreHelper, array $arguments = [] ) { - parent::__construct($resource, $coreHelper, $arguments); + parent::__construct($resource, $objectRelationProcessor, $coreHelper, $arguments); if (isset($arguments['entity_type'])) { $this->_entityType = $arguments['entity_type']; diff --git a/app/code/Magento/DesignEditor/Model/Theme/Resource/Change.php b/app/code/Magento/DesignEditor/Model/Theme/Resource/Change.php index fdec8c5f8345a..2b670ae1a8ea5 100644 --- a/app/code/Magento/DesignEditor/Model/Theme/Resource/Change.php +++ b/app/code/Magento/DesignEditor/Model/Theme/Resource/Change.php @@ -17,13 +17,17 @@ class Change extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param \Magento\Framework\Stdlib\DateTime $dateTime * @return void */ - public function __construct(\Magento\Framework\App\Resource $resource, \Magento\Framework\Stdlib\DateTime $dateTime) - { + public function __construct( + \Magento\Framework\App\Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Stdlib\DateTime $dateTime + ) { $this->dateTime = $dateTime; - parent::__construct($resource); + parent::__construct($resource, $objectRelationProcessor); } /** diff --git a/app/code/Magento/Directory/Model/Resource/Region.php b/app/code/Magento/Directory/Model/Resource/Region.php index f6d3ddeed2286..58ec9a18e0b6d 100644 --- a/app/code/Magento/Directory/Model/Resource/Region.php +++ b/app/code/Magento/Directory/Model/Resource/Region.php @@ -27,11 +27,15 @@ class Region extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param \Magento\Framework\Locale\ResolverInterface $localeResolver */ - public function __construct(\Magento\Framework\App\Resource $resource, \Magento\Framework\Locale\ResolverInterface $localeResolver) - { - parent::__construct($resource); + public function __construct( + \Magento\Framework\App\Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Locale\ResolverInterface $localeResolver + ) { + parent::__construct($resource, $objectRelationProcessor); $this->_localeResolver = $localeResolver; } diff --git a/app/code/Magento/Downloadable/Model/Resource/Link.php b/app/code/Magento/Downloadable/Model/Resource/Link.php index 1b9da79852e18..8ee288054628d 100644 --- a/app/code/Magento/Downloadable/Model/Resource/Link.php +++ b/app/code/Magento/Downloadable/Model/Resource/Link.php @@ -36,6 +36,7 @@ class Link extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Framework\App\Config\ScopeConfigInterface $configuration * @param \Magento\Directory\Model\CurrencyFactory $currencyFactory @@ -43,6 +44,7 @@ class Link extends \Magento\Framework\Model\Resource\Db\AbstractDb */ public function __construct( \Magento\Framework\App\Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, \Magento\Catalog\Helper\Data $catalogData, \Magento\Framework\App\Config\ScopeConfigInterface $configuration, \Magento\Directory\Model\CurrencyFactory $currencyFactory, @@ -52,7 +54,7 @@ public function __construct( $this->_configuration = $configuration; $this->_currencyFactory = $currencyFactory; $this->_storeManager = $storeManager; - parent::__construct($resource); + parent::__construct($resource, $objectRelationProcessor); } /** diff --git a/app/code/Magento/Eav/Model/Resource/Entity/Attribute.php b/app/code/Magento/Eav/Model/Resource/Entity/Attribute.php index 66dd3594cc6b0..1d1ec5b115f53 100644 --- a/app/code/Magento/Eav/Model/Resource/Entity/Attribute.php +++ b/app/code/Magento/Eav/Model/Resource/Entity/Attribute.php @@ -38,17 +38,19 @@ class Attribute extends \Magento\Framework\Model\Resource\Db\AbstractDb * Class constructor * * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param \Magento\Framework\Store\StoreManagerInterface $storeManager * @param Type $eavEntityType */ public function __construct( \Magento\Framework\App\Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, \Magento\Framework\Store\StoreManagerInterface $storeManager, Type $eavEntityType ) { $this->_storeManager = $storeManager; $this->_eavEntityType = $eavEntityType; - parent::__construct($resource); + parent::__construct($resource, $objectRelationProcessor); } /** diff --git a/app/code/Magento/Eav/Model/Resource/Entity/Attribute/Set.php b/app/code/Magento/Eav/Model/Resource/Entity/Attribute/Set.php index 75dccf2a52dcc..5d0fb84f5055b 100644 --- a/app/code/Magento/Eav/Model/Resource/Entity/Attribute/Set.php +++ b/app/code/Magento/Eav/Model/Resource/Entity/Attribute/Set.php @@ -24,15 +24,17 @@ class Set extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param GroupFactory $attrGroupFactory * @param \Magento\Eav\Model\Config $eavConfig */ public function __construct( \Magento\Framework\App\Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, \Magento\Eav\Model\Resource\Entity\Attribute\GroupFactory $attrGroupFactory, \Magento\Eav\Model\Config $eavConfig ) { - parent::__construct($resource); + parent::__construct($resource, $objectRelationProcessor); $this->_attrGroupFactory = $attrGroupFactory; $this->eavConfig = $eavConfig; } diff --git a/app/code/Magento/Email/Model/Resource/Template.php b/app/code/Magento/Email/Model/Resource/Template.php index fdff9c6aced1f..b7cafcca61e99 100644 --- a/app/code/Magento/Email/Model/Resource/Template.php +++ b/app/code/Magento/Email/Model/Resource/Template.php @@ -21,12 +21,16 @@ class Template extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param \Magento\Framework\Stdlib\DateTime $dateTime */ - public function __construct(\Magento\Framework\App\Resource $resource, \Magento\Framework\Stdlib\DateTime $dateTime) - { + public function __construct( + \Magento\Framework\App\Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Stdlib\DateTime $dateTime + ) { $this->dateTime = $dateTime; - parent::__construct($resource); + parent::__construct($resource, $objectRelationProcessor); } /** diff --git a/app/code/Magento/ImportExport/Model/Resource/Import/Data.php b/app/code/Magento/ImportExport/Model/Resource/Import/Data.php index d05f45a540593..a98792121715b 100644 --- a/app/code/Magento/ImportExport/Model/Resource/Import/Data.php +++ b/app/code/Magento/ImportExport/Model/Resource/Import/Data.php @@ -28,15 +28,17 @@ class Data extends \Magento\Framework\Model\Resource\Db\AbstractDb implements \I * Class constructor * * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param \Magento\Core\Helper\Data $coreHelper * @param array $arguments */ public function __construct( \Magento\Framework\App\Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, \Magento\Core\Helper\Data $coreHelper, array $arguments = [] ) { - parent::__construct($resource); + parent::__construct($resource, $objectRelationProcessor); $this->_jsonHelper = $coreHelper; } diff --git a/app/code/Magento/Integration/Model/Resource/Oauth/Consumer.php b/app/code/Magento/Integration/Model/Resource/Oauth/Consumer.php index fa7d3be9807d8..7c39726a40dcf 100644 --- a/app/code/Magento/Integration/Model/Resource/Oauth/Consumer.php +++ b/app/code/Magento/Integration/Model/Resource/Oauth/Consumer.php @@ -14,12 +14,16 @@ class Consumer extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param \Magento\Framework\Stdlib\DateTime $dateTime */ - public function __construct(\Magento\Framework\App\Resource $resource, \Magento\Framework\Stdlib\DateTime $dateTime) - { + public function __construct( + \Magento\Framework\App\Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Stdlib\DateTime $dateTime + ) { $this->_dateTime = $dateTime; - parent::__construct($resource); + parent::__construct($resource, $objectRelationProcessor); } /** diff --git a/app/code/Magento/Integration/Model/Resource/Oauth/Token.php b/app/code/Magento/Integration/Model/Resource/Oauth/Token.php index 150986cf772ce..b47c97336c7a1 100644 --- a/app/code/Magento/Integration/Model/Resource/Oauth/Token.php +++ b/app/code/Magento/Integration/Model/Resource/Oauth/Token.php @@ -19,12 +19,16 @@ class Token extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param \Magento\Framework\Stdlib\DateTime $dateTime */ - public function __construct(\Magento\Framework\App\Resource $resource, \Magento\Framework\Stdlib\DateTime $dateTime) - { + public function __construct( + \Magento\Framework\App\Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Stdlib\DateTime $dateTime + ) { $this->_dateTime = $dateTime; - parent::__construct($resource); + parent::__construct($resource, $objectRelationProcessor); } /** diff --git a/app/code/Magento/Log/Model/Resource/Log.php b/app/code/Magento/Log/Model/Resource/Log.php index a5f9996ba4563..88ed3ebbf724c 100644 --- a/app/code/Magento/Log/Model/Resource/Log.php +++ b/app/code/Magento/Log/Model/Resource/Log.php @@ -31,12 +31,14 @@ class Log extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param \Magento\Framework\Stdlib\DateTime\DateTime $date * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Framework\Stdlib\DateTime $dateTime */ public function __construct( \Magento\Framework\App\Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, \Magento\Framework\Stdlib\DateTime\DateTime $date, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Framework\Stdlib\DateTime $dateTime @@ -44,7 +46,7 @@ public function __construct( $this->_date = $date; $this->_eventManager = $eventManager; $this->dateTime = $dateTime; - parent::__construct($resource); + parent::__construct($resource, $objectRelationProcessor); } /** diff --git a/app/code/Magento/Log/Model/Resource/Visitor.php b/app/code/Magento/Log/Model/Resource/Visitor.php index 0631f7db84ca2..2a852a21c4c27 100644 --- a/app/code/Magento/Log/Model/Resource/Visitor.php +++ b/app/code/Magento/Log/Model/Resource/Visitor.php @@ -36,12 +36,14 @@ class Visitor extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param \Magento\Framework\Stdlib\DateTime\DateTime $date * @param \Magento\Framework\Store\StoreManagerInterface $storeManager * @param \Magento\Framework\Stdlib\String $string */ public function __construct( \Magento\Framework\App\Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, \Magento\Framework\Stdlib\DateTime\DateTime $date, \Magento\Framework\Store\StoreManagerInterface $storeManager, \Magento\Framework\Stdlib\String $string @@ -49,7 +51,7 @@ public function __construct( $this->_date = $date; $this->_storeManager = $storeManager; $this->string = $string; - parent::__construct($resource); + parent::__construct($resource, $objectRelationProcessor); } /** diff --git a/app/code/Magento/Log/Model/Resource/Visitor/Online.php b/app/code/Magento/Log/Model/Resource/Visitor/Online.php index ffdfe18859e6a..00370e5d32a95 100644 --- a/app/code/Magento/Log/Model/Resource/Visitor/Online.php +++ b/app/code/Magento/Log/Model/Resource/Visitor/Online.php @@ -22,12 +22,16 @@ class Online extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param \Magento\Framework\Stdlib\DateTime\DateTime $date */ - public function __construct(\Magento\Framework\App\Resource $resource, \Magento\Framework\Stdlib\DateTime\DateTime $date) - { + public function __construct( + \Magento\Framework\App\Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Stdlib\DateTime\DateTime $date + ) { $this->_date = $date; - parent::__construct($resource); + parent::__construct($resource, $objectRelationProcessor); } /** diff --git a/app/code/Magento/Newsletter/Model/Resource/Queue.php b/app/code/Magento/Newsletter/Model/Resource/Queue.php index 6da543c452be2..142b365411d8a 100644 --- a/app/code/Magento/Newsletter/Model/Resource/Queue.php +++ b/app/code/Magento/Newsletter/Model/Resource/Queue.php @@ -26,13 +26,15 @@ class Queue extends \Magento\Framework\Model\Resource\Db\AbstractDb * Construct * * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param \Magento\Newsletter\Model\Resource\Subscriber\Collection $subscriberCollection */ public function __construct( \Magento\Framework\App\Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, \Magento\Newsletter\Model\Resource\Subscriber\Collection $subscriberCollection ) { - parent::__construct($resource); + parent::__construct($resource, $objectRelationProcessor); $this->_subscriberCollection = $subscriberCollection; } diff --git a/app/code/Magento/Newsletter/Model/Resource/Subscriber.php b/app/code/Magento/Newsletter/Model/Resource/Subscriber.php index 6c5711e2e04ab..96d23c97e5957 100644 --- a/app/code/Magento/Newsletter/Model/Resource/Subscriber.php +++ b/app/code/Magento/Newsletter/Model/Resource/Subscriber.php @@ -56,17 +56,19 @@ class Subscriber extends \Magento\Framework\Model\Resource\Db\AbstractDb * Construct * * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param \Magento\Framework\Stdlib\DateTime\DateTime $date * @param \Magento\Framework\Math\Random $mathRandom */ public function __construct( \Magento\Framework\App\Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, \Magento\Framework\Stdlib\DateTime\DateTime $date, \Magento\Framework\Math\Random $mathRandom ) { $this->_date = $date; $this->mathRandom = $mathRandom; - parent::__construct($resource); + parent::__construct($resource, $objectRelationProcessor); } /** diff --git a/app/code/Magento/Newsletter/Model/Resource/Template.php b/app/code/Magento/Newsletter/Model/Resource/Template.php index 9ca3e1351e294..cef257d11d9fa 100644 --- a/app/code/Magento/Newsletter/Model/Resource/Template.php +++ b/app/code/Magento/Newsletter/Model/Resource/Template.php @@ -24,11 +24,15 @@ class Template extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param \Magento\Framework\Stdlib\DateTime\DateTime $date */ - public function __construct(\Magento\Framework\App\Resource $resource, \Magento\Framework\Stdlib\DateTime\DateTime $date) - { - parent::__construct($resource); + public function __construct( + \Magento\Framework\App\Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Stdlib\DateTime\DateTime $date + ) { + parent::__construct($resource, $objectRelationProcessor); $this->_date = $date; } diff --git a/app/code/Magento/OfflineShipping/Model/Resource/Carrier/Tablerate.php b/app/code/Magento/OfflineShipping/Model/Resource/Carrier/Tablerate.php index 6c5869c7bd2e0..ebc87479fd1dc 100644 --- a/app/code/Magento/OfflineShipping/Model/Resource/Carrier/Tablerate.php +++ b/app/code/Magento/OfflineShipping/Model/Resource/Carrier/Tablerate.php @@ -123,6 +123,7 @@ class Tablerate extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\App\Config\ScopeConfigInterface $coreConfig * @param \Magento\Framework\Store\StoreManagerInterface $storeManager @@ -133,6 +134,7 @@ class Tablerate extends \Magento\Framework\Model\Resource\Db\AbstractDb */ public function __construct( \Magento\Framework\App\Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, \Psr\Log\LoggerInterface $logger, \Magento\Framework\App\Config\ScopeConfigInterface $coreConfig, \Magento\Framework\Store\StoreManagerInterface $storeManager, @@ -141,7 +143,7 @@ public function __construct( \Magento\Directory\Model\Resource\Region\CollectionFactory $regionCollectionFactory, \Magento\Framework\Filesystem $filesystem ) { - parent::__construct($resource); + parent::__construct($resource, $objectRelationProcessor); $this->_coreConfig = $coreConfig; $this->_logger = $logger; $this->_storeManager = $storeManager; diff --git a/app/code/Magento/Persistent/Model/Resource/Session.php b/app/code/Magento/Persistent/Model/Resource/Session.php index 8846d52e3e048..3e3726526f28d 100644 --- a/app/code/Magento/Persistent/Model/Resource/Session.php +++ b/app/code/Magento/Persistent/Model/Resource/Session.php @@ -28,14 +28,16 @@ class Session extends \Magento\Framework\Model\Resource\Db\AbstractDb * Class constructor * * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param \Magento\Persistent\Model\SessionFactory $sessionFactory */ public function __construct( \Magento\Framework\App\Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, \Magento\Persistent\Model\SessionFactory $sessionFactory ) { $this->_sessionFactory = $sessionFactory; - parent::__construct($resource); + parent::__construct($resource, $objectRelationProcessor); } /** diff --git a/app/code/Magento/ProductAlert/Model/Resource/Price.php b/app/code/Magento/ProductAlert/Model/Resource/Price.php index 1d457c4981b8a..6086f997835d5 100644 --- a/app/code/Magento/ProductAlert/Model/Resource/Price.php +++ b/app/code/Magento/ProductAlert/Model/Resource/Price.php @@ -20,12 +20,16 @@ class Price extends \Magento\ProductAlert\Model\Resource\AbstractResource /** * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param \Magento\Framework\Stdlib\DateTime\DateTimeFactory $dateFactory */ - public function __construct(\Magento\Framework\App\Resource $resource, \Magento\Framework\Stdlib\DateTime\DateTimeFactory $dateFactory) - { + public function __construct( + \Magento\Framework\App\Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Stdlib\DateTime\DateTimeFactory $dateFactory + ) { $this->_dateFactory = $dateFactory; - parent::__construct($resource); + parent::__construct($resource, $objectRelationProcessor); } /** diff --git a/app/code/Magento/ProductAlert/Model/Resource/Stock.php b/app/code/Magento/ProductAlert/Model/Resource/Stock.php index 637aaea87065d..8984dbaf9649f 100644 --- a/app/code/Magento/ProductAlert/Model/Resource/Stock.php +++ b/app/code/Magento/ProductAlert/Model/Resource/Stock.php @@ -20,12 +20,16 @@ class Stock extends \Magento\ProductAlert\Model\Resource\AbstractResource /** * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param \Magento\Framework\Stdlib\DateTime\DateTimeFactory $dateFactory */ - public function __construct(\Magento\Framework\App\Resource $resource, \Magento\Framework\Stdlib\DateTime\DateTimeFactory $dateFactory) - { + public function __construct( + \Magento\Framework\App\Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Stdlib\DateTime\DateTimeFactory $dateFactory + ) { $this->_dateFactory = $dateFactory; - parent::__construct($resource); + parent::__construct($resource, $objectRelationProcessor); } /** diff --git a/app/code/Magento/Quote/Model/Resource/Quote.php b/app/code/Magento/Quote/Model/Resource/Quote.php index fac8e129483c3..9058335ca89f2 100644 --- a/app/code/Magento/Quote/Model/Resource/Quote.php +++ b/app/code/Magento/Quote/Model/Resource/Quote.php @@ -22,13 +22,15 @@ class Quote extends AbstractDb /** * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param \Magento\Eav\Model\Config $config */ public function __construct( \Magento\Framework\App\Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, \Magento\Eav\Model\Config $config ) { - parent::__construct($resource); + parent::__construct($resource, $objectRelationProcessor); $this->_config = $config; } diff --git a/app/code/Magento/Quote/Model/Resource/Quote/Payment.php b/app/code/Magento/Quote/Model/Resource/Quote/Payment.php index e1ee7dc0e1aae..3275211dbf876 100644 --- a/app/code/Magento/Quote/Model/Resource/Quote/Payment.php +++ b/app/code/Magento/Quote/Model/Resource/Quote/Payment.php @@ -19,15 +19,6 @@ class Payment extends AbstractDb */ protected $_serializableFields = ['additional_information' => [null, []]]; - /** - * @param \Magento\Framework\App\Resource $resource - */ - public function __construct( - \Magento\Framework\App\Resource $resource - ) { - parent::__construct($resource); - } - /** * Main table and field initialization * diff --git a/app/code/Magento/Reports/Model/Resource/Event.php b/app/code/Magento/Reports/Model/Resource/Event.php index 0897d524090db..79889549feb41 100644 --- a/app/code/Magento/Reports/Model/Resource/Event.php +++ b/app/code/Magento/Reports/Model/Resource/Event.php @@ -24,15 +24,17 @@ class Event extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Framework\Store\StoreManagerInterface $storeManager */ public function __construct( \Magento\Framework\App\Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Framework\Store\StoreManagerInterface $storeManager ) { - parent::__construct($resource); + parent::__construct($resource, $objectRelationProcessor); $this->_scopeConfig = $scopeConfig; $this->_storeManager = $storeManager; } diff --git a/app/code/Magento/Reports/Model/Resource/Product/Index/AbstractIndex.php b/app/code/Magento/Reports/Model/Resource/Product/Index/AbstractIndex.php index 9397a7272a74d..36b2717a21f05 100644 --- a/app/code/Magento/Reports/Model/Resource/Product/Index/AbstractIndex.php +++ b/app/code/Magento/Reports/Model/Resource/Product/Index/AbstractIndex.php @@ -25,15 +25,17 @@ abstract class AbstractIndex extends \Magento\Framework\Model\Resource\Db\Abstra /** * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param \Magento\Reports\Model\Resource\Helper $resourceHelper * @param \Magento\Framework\Stdlib\DateTime $dateTime */ public function __construct( \Magento\Framework\App\Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, \Magento\Reports\Model\Resource\Helper $resourceHelper, \Magento\Framework\Stdlib\DateTime $dateTime ) { - parent::__construct($resource); + parent::__construct($resource, $objectRelationProcessor); $this->_resourceHelper = $resourceHelper; $this->dateTime = $dateTime; } diff --git a/app/code/Magento/Reports/Model/Resource/Report/AbstractReport.php b/app/code/Magento/Reports/Model/Resource/Report/AbstractReport.php index 0ffd17fd9c7db..0c1f394b0ad26 100644 --- a/app/code/Magento/Reports/Model/Resource/Report/AbstractReport.php +++ b/app/code/Magento/Reports/Model/Resource/Report/AbstractReport.php @@ -38,6 +38,7 @@ abstract class AbstractReport extends \Magento\Framework\Model\Resource\Db\Abstr /** * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate * @param \Magento\Reports\Model\FlagFactory $reportsFlagFactory @@ -46,13 +47,14 @@ abstract class AbstractReport extends \Magento\Framework\Model\Resource\Db\Abstr */ public function __construct( \Magento\Framework\App\Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, \Psr\Log\LoggerInterface $logger, \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate, \Magento\Reports\Model\FlagFactory $reportsFlagFactory, \Magento\Framework\Stdlib\DateTime $dateTime, \Magento\Framework\Stdlib\DateTime\Timezone\Validator $timezoneValidator ) { - parent::__construct($resource); + parent::__construct($resource, $objectRelationProcessor); $this->_logger = $logger; $this->_localeDate = $localeDate; $this->_reportsFlagFactory = $reportsFlagFactory; diff --git a/app/code/Magento/Reports/Model/Resource/Report/Product/Viewed.php b/app/code/Magento/Reports/Model/Resource/Report/Product/Viewed.php index 4f14518968734..d3e9aa8695984 100644 --- a/app/code/Magento/Reports/Model/Resource/Report/Product/Viewed.php +++ b/app/code/Magento/Reports/Model/Resource/Report/Product/Viewed.php @@ -42,6 +42,7 @@ class Viewed extends \Magento\Sales\Model\Resource\Report\AbstractReport /** * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate * @param \Magento\Reports\Model\FlagFactory $reportsFlagFactory @@ -52,6 +53,7 @@ class Viewed extends \Magento\Sales\Model\Resource\Report\AbstractReport */ public function __construct( \Magento\Framework\App\Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, \Psr\Log\LoggerInterface $logger, \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate, \Magento\Reports\Model\FlagFactory $reportsFlagFactory, @@ -60,7 +62,15 @@ public function __construct( \Magento\Catalog\Model\Resource\Product $productResource, \Magento\Reports\Model\Resource\Helper $resourceHelper ) { - parent::__construct($resource, $logger, $localeDate, $reportsFlagFactory, $dateTime, $timezoneValidator); + parent::__construct( + $resource, + $objectRelationProcessor, + $logger, + $localeDate, + $reportsFlagFactory, + $dateTime, + $timezoneValidator + ); $this->_productResource = $productResource; $this->_resourceHelper = $resourceHelper; } diff --git a/app/code/Magento/Review/Model/Resource/Rating.php b/app/code/Magento/Review/Model/Resource/Rating.php index 6d067d4167ddc..2676fd424f1d0 100644 --- a/app/code/Magento/Review/Model/Resource/Rating.php +++ b/app/code/Magento/Review/Model/Resource/Rating.php @@ -33,6 +33,7 @@ class Rating extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Module\Manager $moduleManager * @param \Magento\Framework\Store\StoreManagerInterface $storeManager @@ -40,6 +41,7 @@ class Rating extends \Magento\Framework\Model\Resource\Db\AbstractDb */ public function __construct( \Magento\Framework\App\Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, \Psr\Log\LoggerInterface $logger, \Magento\Framework\Module\Manager $moduleManager, \Magento\Framework\Store\StoreManagerInterface $storeManager, @@ -49,7 +51,7 @@ public function __construct( $this->_storeManager = $storeManager; $this->_logger = $logger; $this->_reviewSummary = $reviewSummary; - parent::__construct($resource); + parent::__construct($resource, $objectRelationProcessor); } /** diff --git a/app/code/Magento/Review/Model/Resource/Rating/Option.php b/app/code/Magento/Review/Model/Resource/Rating/Option.php index 4fe3af8124772..7446d9e56d3a1 100644 --- a/app/code/Magento/Review/Model/Resource/Rating/Option.php +++ b/app/code/Magento/Review/Model/Resource/Rating/Option.php @@ -80,12 +80,14 @@ class Option extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Review\Model\Rating\Option\VoteFactory $ratingOptionVoteF * @param \Magento\Framework\HTTP\PhpEnvironment\RemoteAddress $remoteAddress */ public function __construct( \Magento\Framework\App\Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, \Magento\Customer\Model\Session $customerSession, \Magento\Review\Model\Rating\Option\VoteFactory $ratingOptionVoteF, \Magento\Framework\HTTP\PhpEnvironment\RemoteAddress $remoteAddress @@ -93,7 +95,7 @@ public function __construct( $this->_customerSession = $customerSession; $this->_ratingOptionVoteF = $ratingOptionVoteF; $this->_remoteAddress = $remoteAddress; - parent::__construct($resource); + parent::__construct($resource, $objectRelationProcessor); } /** diff --git a/app/code/Magento/Review/Model/Resource/Review.php b/app/code/Magento/Review/Model/Resource/Review.php index 3060a7072f747..3387fa5f96c7c 100644 --- a/app/code/Magento/Review/Model/Resource/Review.php +++ b/app/code/Magento/Review/Model/Resource/Review.php @@ -91,6 +91,7 @@ class Review extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param \Magento\Framework\Stdlib\DateTime\DateTime $date * @param \Magento\Framework\Store\StoreManagerInterface $storeManager * @param \Magento\Review\Model\RatingFactory $ratingFactory @@ -98,6 +99,7 @@ class Review extends \Magento\Framework\Model\Resource\Db\AbstractDb */ public function __construct( \Magento\Framework\App\Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, \Magento\Framework\Stdlib\DateTime\DateTime $date, \Magento\Framework\Store\StoreManagerInterface $storeManager, \Magento\Review\Model\RatingFactory $ratingFactory, @@ -108,7 +110,7 @@ public function __construct( $this->_ratingFactory = $ratingFactory; $this->_ratingOptions = $ratingOptions; - parent::__construct($resource); + parent::__construct($resource, $objectRelationProcessor); } /** diff --git a/app/code/Magento/Sales/Model/Resource/AbstractGrid.php b/app/code/Magento/Sales/Model/Resource/AbstractGrid.php index dc2952e8b17ef..c04f8e0bf6bf9 100644 --- a/app/code/Magento/Sales/Model/Resource/AbstractGrid.php +++ b/app/code/Magento/Sales/Model/Resource/AbstractGrid.php @@ -36,10 +36,13 @@ abstract class AbstractGrid extends AbstractDb implements GridInterface /** * @param AppResource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor */ - public function __construct(AppResource $resource) - { - parent::__construct($resource); + public function __construct( + AppResource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + ) { + parent::__construct($resource, $objectRelationProcessor); } /** diff --git a/app/code/Magento/Sales/Model/Resource/Entity.php b/app/code/Magento/Sales/Model/Resource/Entity.php index 2cc6faf6f1266..f7d820409d59f 100644 --- a/app/code/Magento/Sales/Model/Resource/Entity.php +++ b/app/code/Magento/Sales/Model/Resource/Entity.php @@ -57,12 +57,14 @@ abstract class Entity extends AbstractDb /** * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param Attribute $attribute * @param \Magento\Sales\Model\Increment $salesIncrement * @param GridInterface|null $gridAggregator */ public function __construct( \Magento\Framework\App\Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, \Magento\Sales\Model\Resource\Attribute $attribute, \Magento\Sales\Model\Increment $salesIncrement, \Magento\Sales\Model\Resource\GridInterface $gridAggregator = null @@ -70,7 +72,7 @@ public function __construct( $this->attribute = $attribute; $this->salesIncrement = $salesIncrement; $this->gridAggregator = $gridAggregator; - parent::__construct($resource); + parent::__construct($resource, $objectRelationProcessor); } /** diff --git a/app/code/Magento/Sales/Model/Resource/Order.php b/app/code/Magento/Sales/Model/Resource/Order.php index cb8a0ffa100ba..a7c537a9a1da4 100644 --- a/app/code/Magento/Sales/Model/Resource/Order.php +++ b/app/code/Magento/Sales/Model/Resource/Order.php @@ -57,6 +57,7 @@ protected function _construct() /** * @param AppResource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param Attribute $attribute * @param SalesIncrement $salesIncrement * @param AddressHandler $addressHandler @@ -65,6 +66,7 @@ protected function _construct() */ public function __construct( AppResource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, Attribute $attribute, SalesIncrement $salesIncrement, AddressHandler $addressHandler, @@ -73,7 +75,7 @@ public function __construct( ) { $this->stateHandler = $stateHandler; $this->addressHandler = $addressHandler; - parent::__construct($resource, $attribute, $salesIncrement, $gridAggregator); + parent::__construct($resource, $objectRelationProcessor, $attribute, $salesIncrement, $gridAggregator); } /** diff --git a/app/code/Magento/Sales/Model/Resource/Order/Address.php b/app/code/Magento/Sales/Model/Resource/Order/Address.php index 64def18706927..1d0facaf1c76c 100644 --- a/app/code/Magento/Sales/Model/Resource/Order/Address.php +++ b/app/code/Magento/Sales/Model/Resource/Order/Address.php @@ -32,6 +32,7 @@ class Address extends SalesResource implements OrderAddressResourceInterface /** * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param \Magento\Sales\Model\Resource\Attribute $attribute * @param \Magento\Sales\Model\Increment $salesIncrement * @param \Magento\Sales\Model\Order\Address\Validator $validator @@ -40,6 +41,7 @@ class Address extends SalesResource implements OrderAddressResourceInterface */ public function __construct( \Magento\Framework\App\Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, \Magento\Sales\Model\Resource\Attribute $attribute, \Magento\Sales\Model\Increment $salesIncrement, \Magento\Sales\Model\Order\Address\Validator $validator, @@ -48,7 +50,7 @@ public function __construct( ) { $this->_validator = $validator; $this->gridPool = $gridPool; - parent::__construct($resource, $attribute, $salesIncrement, $gridAggregator); + parent::__construct($resource, $objectRelationProcessor, $attribute, $salesIncrement, $gridAggregator); } /** diff --git a/app/code/Magento/Sales/Model/Resource/Order/Creditmemo.php b/app/code/Magento/Sales/Model/Resource/Order/Creditmemo.php index cc23c0550e475..e7970010f3ac1 100644 --- a/app/code/Magento/Sales/Model/Resource/Order/Creditmemo.php +++ b/app/code/Magento/Sales/Model/Resource/Order/Creditmemo.php @@ -40,17 +40,19 @@ protected function _construct() * Constructor * * @param AppResource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param Attribute $attribute * @param SalesIncrement $salesIncrement * @param CreditmemoGrid $gridAggregator */ public function __construct( AppResource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, Attribute $attribute, SalesIncrement $salesIncrement, CreditmemoGrid $gridAggregator ) { - parent::__construct($resource, $attribute, $salesIncrement, $gridAggregator); + parent::__construct($resource, $objectRelationProcessor, $attribute, $salesIncrement, $gridAggregator); } /** diff --git a/app/code/Magento/Sales/Model/Resource/Order/Creditmemo/Comment.php b/app/code/Magento/Sales/Model/Resource/Order/Creditmemo/Comment.php index 252c75881b67a..f839500452bc9 100644 --- a/app/code/Magento/Sales/Model/Resource/Order/Creditmemo/Comment.php +++ b/app/code/Magento/Sales/Model/Resource/Order/Creditmemo/Comment.php @@ -31,6 +31,7 @@ class Comment extends Entity implements CreditmemoCommentResourceInterface /** * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param \Magento\Sales\Model\Resource\Attribute $attribute * @param \Magento\Sales\Model\Increment $salesIncrement * @param \Magento\Sales\Model\Order\Creditmemo\Comment\Validator $validator @@ -38,13 +39,14 @@ class Comment extends Entity implements CreditmemoCommentResourceInterface */ public function __construct( \Magento\Framework\App\Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, \Magento\Sales\Model\Resource\Attribute $attribute, \Magento\Sales\Model\Increment $salesIncrement, \Magento\Sales\Model\Order\Creditmemo\Comment\Validator $validator, \Magento\Sales\Model\Resource\GridInterface $gridAggregator = null ) { $this->validator = $validator; - parent::__construct($resource, $attribute, $salesIncrement, $gridAggregator); + parent::__construct($resource, $objectRelationProcessor, $attribute, $salesIncrement, $gridAggregator); } /** diff --git a/app/code/Magento/Sales/Model/Resource/Order/Invoice.php b/app/code/Magento/Sales/Model/Resource/Order/Invoice.php index 6daf36254290c..c934d10b343c4 100644 --- a/app/code/Magento/Sales/Model/Resource/Order/Invoice.php +++ b/app/code/Magento/Sales/Model/Resource/Order/Invoice.php @@ -36,17 +36,19 @@ protected function _construct() /** * @param Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param Attribute $attribute * @param SalesIncrement $salesIncrement * @param InvoiceGrid $gridAggregator */ public function __construct( Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, Attribute $attribute, SalesIncrement $salesIncrement, InvoiceGrid $gridAggregator ) { - parent::__construct($resource, $attribute, $salesIncrement, $gridAggregator); + parent::__construct($resource, $objectRelationProcessor, $attribute, $salesIncrement, $gridAggregator); } /** diff --git a/app/code/Magento/Sales/Model/Resource/Order/Invoice/Comment.php b/app/code/Magento/Sales/Model/Resource/Order/Invoice/Comment.php index 51b72132553ad..5ea5f2fd9fa2c 100644 --- a/app/code/Magento/Sales/Model/Resource/Order/Invoice/Comment.php +++ b/app/code/Magento/Sales/Model/Resource/Order/Invoice/Comment.php @@ -31,6 +31,7 @@ class Comment extends Entity implements InvoiceCommentResourceInterface /** * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param \Magento\Sales\Model\Resource\Attribute $attribute * @param \Magento\Sales\Model\Increment $salesIncrement * @param \Magento\Sales\Model\Order\Invoice\Comment\Validator $validator @@ -38,13 +39,14 @@ class Comment extends Entity implements InvoiceCommentResourceInterface */ public function __construct( \Magento\Framework\App\Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, \Magento\Sales\Model\Resource\Attribute $attribute, \Magento\Sales\Model\Increment $salesIncrement, \Magento\Sales\Model\Order\Invoice\Comment\Validator $validator, \Magento\Sales\Model\Resource\GridInterface $gridAggregator = null ) { $this->validator = $validator; - parent::__construct($resource, $attribute, $salesIncrement, $gridAggregator); + parent::__construct($resource, $objectRelationProcessor, $attribute, $salesIncrement, $gridAggregator); } /** diff --git a/app/code/Magento/Sales/Model/Resource/Order/Shipment.php b/app/code/Magento/Sales/Model/Resource/Order/Shipment.php index bb8b98bb0c89f..bfbfce8b39ef1 100644 --- a/app/code/Magento/Sales/Model/Resource/Order/Shipment.php +++ b/app/code/Magento/Sales/Model/Resource/Order/Shipment.php @@ -45,17 +45,19 @@ protected function _construct() /** * @param AppResource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param Attribute $attribute * @param SalesIncrement $salesIncrement * @param ShipmentGrid $gridAggregator */ public function __construct( AppResource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, Attribute $attribute, SalesIncrement $salesIncrement, ShipmentGrid $gridAggregator ) { - parent::__construct($resource, $attribute, $salesIncrement, $gridAggregator); + parent::__construct($resource, $objectRelationProcessor, $attribute, $salesIncrement, $gridAggregator); } /** diff --git a/app/code/Magento/Sales/Model/Resource/Order/Shipment/Comment.php b/app/code/Magento/Sales/Model/Resource/Order/Shipment/Comment.php index 822060f8bec2f..409079e71bb61 100644 --- a/app/code/Magento/Sales/Model/Resource/Order/Shipment/Comment.php +++ b/app/code/Magento/Sales/Model/Resource/Order/Shipment/Comment.php @@ -31,6 +31,7 @@ class Comment extends Entity implements ShipmentCommentResourceInterface /** * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param \Magento\Sales\Model\Resource\Attribute $attribute * @param \Magento\Sales\Model\Increment $salesIncrement * @param \Magento\Sales\Model\Order\Shipment\Comment\Validator $validator @@ -38,13 +39,14 @@ class Comment extends Entity implements ShipmentCommentResourceInterface */ public function __construct( \Magento\Framework\App\Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, \Magento\Sales\Model\Resource\Attribute $attribute, \Magento\Sales\Model\Increment $salesIncrement, \Magento\Sales\Model\Order\Shipment\Comment\Validator $validator, \Magento\Sales\Model\Resource\GridInterface $gridAggregator = null ) { $this->validator = $validator; - parent::__construct($resource, $attribute, $salesIncrement, $gridAggregator); + parent::__construct($resource, $objectRelationProcessor, $attribute, $salesIncrement, $gridAggregator); } /** diff --git a/app/code/Magento/Sales/Model/Resource/Order/Shipment/Track.php b/app/code/Magento/Sales/Model/Resource/Order/Shipment/Track.php index ecbc6d3586052..ca90ec49ad04b 100644 --- a/app/code/Magento/Sales/Model/Resource/Order/Shipment/Track.php +++ b/app/code/Magento/Sales/Model/Resource/Order/Shipment/Track.php @@ -31,6 +31,7 @@ class Track extends SalesResource implements ShipmentTrackResourceInterface /** * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param \Magento\Sales\Model\Resource\Attribute $attribute * @param \Magento\Sales\Model\Increment $salesIncrement * @param \Magento\Sales\Model\Order\Shipment\Track\Validator $validator @@ -38,13 +39,14 @@ class Track extends SalesResource implements ShipmentTrackResourceInterface */ public function __construct( \Magento\Framework\App\Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, \Magento\Sales\Model\Resource\Attribute $attribute, \Magento\Sales\Model\Increment $salesIncrement, \Magento\Sales\Model\Order\Shipment\Track\Validator $validator, \Magento\Sales\Model\Resource\GridInterface $gridAggregator = null ) { $this->validator = $validator; - parent::__construct($resource, $attribute, $salesIncrement, $gridAggregator); + parent::__construct($resource, $objectRelationProcessor, $attribute, $salesIncrement, $gridAggregator); } /** diff --git a/app/code/Magento/Sales/Model/Resource/Order/Status.php b/app/code/Magento/Sales/Model/Resource/Order/Status.php index fb47d4cb1781c..69cc3d6831373 100644 --- a/app/code/Magento/Sales/Model/Resource/Order/Status.php +++ b/app/code/Magento/Sales/Model/Resource/Order/Status.php @@ -39,14 +39,16 @@ class Status extends \Magento\Framework\Model\Resource\Db\AbstractDb * Class constructor * * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param LogWriter $logger */ public function __construct( Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, LogWriter $logger ) { $this->logger = $logger; - parent::__construct($resource); + parent::__construct($resource, $objectRelationProcessor); } /** diff --git a/app/code/Magento/Sales/Model/Resource/Order/Status/History.php b/app/code/Magento/Sales/Model/Resource/Order/Status/History.php index 723fdc506a9a0..c97e78a4dc2d2 100644 --- a/app/code/Magento/Sales/Model/Resource/Order/Status/History.php +++ b/app/code/Magento/Sales/Model/Resource/Order/Status/History.php @@ -23,6 +23,7 @@ class History extends Entity implements OrderStatusHistoryResourceInterface /** * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param \Magento\Framework\Stdlib\DateTime $dateTime * @param \Magento\Sales\Model\Resource\Attribute $attribute * @param \Magento\Sales\Model\Increment $salesIncrement @@ -31,13 +32,14 @@ class History extends Entity implements OrderStatusHistoryResourceInterface */ public function __construct( \Magento\Framework\App\Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, \Magento\Sales\Model\Resource\Attribute $attribute, \Magento\Sales\Model\Increment $salesIncrement, Validator $validator, \Magento\Sales\Model\Resource\GridInterface $gridAggregator = null ) { $this->validator = $validator; - parent::__construct($resource, $attribute, $salesIncrement, $gridAggregator); + parent::__construct($resource, $objectRelationProcessor, $attribute, $salesIncrement, $gridAggregator); } /** diff --git a/app/code/Magento/Sales/Model/Resource/Report/Bestsellers.php b/app/code/Magento/Sales/Model/Resource/Report/Bestsellers.php index 173d376346079..0d234567afa24 100644 --- a/app/code/Magento/Sales/Model/Resource/Report/Bestsellers.php +++ b/app/code/Magento/Sales/Model/Resource/Report/Bestsellers.php @@ -38,6 +38,7 @@ class Bestsellers extends AbstractReport /** * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate * @param \Magento\Reports\Model\FlagFactory $reportsFlagFactory @@ -49,6 +50,7 @@ class Bestsellers extends AbstractReport */ public function __construct( \Magento\Framework\App\Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, \Psr\Log\LoggerInterface $logger, \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate, \Magento\Reports\Model\FlagFactory $reportsFlagFactory, @@ -58,7 +60,15 @@ public function __construct( \Magento\Sales\Model\Resource\Helper $salesResourceHelper, array $ignoredProductTypes = [] ) { - parent::__construct($resource, $logger, $localeDate, $reportsFlagFactory, $dateTime, $timezoneValidator); + parent::__construct( + $resource, + $objectRelationProcessor, + $logger, + $localeDate, + $reportsFlagFactory, + $dateTime, + $timezoneValidator + ); $this->_productResource = $productResource; $this->_salesResourceHelper = $salesResourceHelper; $this->ignoredProductTypes = array_merge($this->ignoredProductTypes, $ignoredProductTypes); diff --git a/app/code/Magento/Sales/Model/Resource/Report/Order.php b/app/code/Magento/Sales/Model/Resource/Report/Order.php index 50a03c50638ef..04c19acc4ac73 100644 --- a/app/code/Magento/Sales/Model/Resource/Report/Order.php +++ b/app/code/Magento/Sales/Model/Resource/Report/Order.php @@ -22,6 +22,7 @@ class Order extends AbstractReport /** * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate * @param \Magento\Reports\Model\FlagFactory $reportsFlagFactory @@ -32,6 +33,7 @@ class Order extends AbstractReport */ public function __construct( \Magento\Framework\App\Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, \Psr\Log\LoggerInterface $logger, \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate, \Magento\Reports\Model\FlagFactory $reportsFlagFactory, @@ -40,7 +42,15 @@ public function __construct( \Magento\Sales\Model\Resource\Report\Order\CreatedatFactory $createDatFactory, \Magento\Sales\Model\Resource\Report\Order\UpdatedatFactory $updateDatFactory ) { - parent::__construct($resource, $logger, $localeDate, $reportsFlagFactory, $dateTime, $timezoneValidator); + parent::__construct( + $resource, + $objectRelationProcessor, + $logger, + $localeDate, + $reportsFlagFactory, + $dateTime, + $timezoneValidator + ); $this->_createDatFactory = $createDatFactory; $this->_updateDatFactory = $updateDatFactory; } diff --git a/app/code/Magento/SalesRule/Model/Resource/Report/Rule.php b/app/code/Magento/SalesRule/Model/Resource/Report/Rule.php index 761804a0754e4..b98b411e1bcae 100644 --- a/app/code/Magento/SalesRule/Model/Resource/Report/Rule.php +++ b/app/code/Magento/SalesRule/Model/Resource/Report/Rule.php @@ -24,6 +24,7 @@ class Rule extends \Magento\Reports\Model\Resource\Report\AbstractReport /** * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate * @param \Magento\Reports\Model\FlagFactory $reportsFlagFactory @@ -34,6 +35,7 @@ class Rule extends \Magento\Reports\Model\Resource\Report\AbstractReport */ public function __construct( \Magento\Framework\App\Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, \Psr\Log\LoggerInterface $logger, \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate, \Magento\Reports\Model\FlagFactory $reportsFlagFactory, @@ -42,7 +44,15 @@ public function __construct( \Magento\SalesRule\Model\Resource\Report\Rule\CreatedatFactory $createdatFactory, \Magento\SalesRule\Model\Resource\Report\Rule\UpdatedatFactory $updatedatFactory ) { - parent::__construct($resource, $logger, $localeDate, $reportsFlagFactory, $dateTime, $timezoneValidator); + parent::__construct( + $resource, + $objectRelationProcessor, + $logger, + $localeDate, + $reportsFlagFactory, + $dateTime, + $timezoneValidator + ); $this->_createdatFactory = $createdatFactory; $this->_updatedatFactory = $updatedatFactory; } diff --git a/app/code/Magento/SalesRule/Model/Resource/Rule.php b/app/code/Magento/SalesRule/Model/Resource/Rule.php index cfe744acdc2b4..fc23a9a8fe325 100644 --- a/app/code/Magento/SalesRule/Model/Resource/Rule.php +++ b/app/code/Magento/SalesRule/Model/Resource/Rule.php @@ -44,17 +44,19 @@ class Rule extends \Magento\Rule\Model\Resource\AbstractResource /** * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param \Magento\Framework\Stdlib\String $string * @param \Magento\SalesRule\Model\Resource\Coupon $resourceCoupon */ public function __construct( \Magento\Framework\App\Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, \Magento\Framework\Stdlib\String $string, \Magento\SalesRule\Model\Resource\Coupon $resourceCoupon ) { $this->string = $string; $this->_resourceCoupon = $resourceCoupon; - parent::__construct($resource); + parent::__construct($resource, $objectRelationProcessor); } /** diff --git a/app/code/Magento/Search/Model/Resource/Query.php b/app/code/Magento/Search/Model/Resource/Query.php index b2af20520e73f..12cd84627bb65 100644 --- a/app/code/Magento/Search/Model/Resource/Query.php +++ b/app/code/Magento/Search/Model/Resource/Query.php @@ -32,17 +32,19 @@ class Query extends AbstractDb /** * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param \Magento\Framework\Stdlib\DateTime\DateTime $date * @param \Magento\Framework\Stdlib\DateTime $dateTime */ public function __construct( \Magento\Framework\App\Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, \Magento\Framework\Stdlib\DateTime\DateTime $date, \Magento\Framework\Stdlib\DateTime $dateTime ) { $this->_date = $date; $this->dateTime = $dateTime; - parent::__construct($resource); + parent::__construct($resource, $objectRelationProcessor); } /** diff --git a/app/code/Magento/Sitemap/Model/Resource/Catalog/Category.php b/app/code/Magento/Sitemap/Model/Resource/Catalog/Category.php index 5b617eb4be1a3..495ff3541debd 100644 --- a/app/code/Magento/Sitemap/Model/Resource/Catalog/Category.php +++ b/app/code/Magento/Sitemap/Model/Resource/Catalog/Category.php @@ -40,17 +40,19 @@ class Category extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param \Magento\Framework\Store\StoreManagerInterface $storeManager * @param \Magento\Catalog\Model\Resource\Category $categoryResource */ public function __construct( \Magento\Framework\App\Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, \Magento\Framework\Store\StoreManagerInterface $storeManager, \Magento\Catalog\Model\Resource\Category $categoryResource ) { $this->_storeManager = $storeManager; $this->_categoryResource = $categoryResource; - parent::__construct($resource); + parent::__construct($resource, $objectRelationProcessor); } /** diff --git a/app/code/Magento/Sitemap/Model/Resource/Catalog/Product.php b/app/code/Magento/Sitemap/Model/Resource/Catalog/Product.php index 3e6f958844a9c..a274abee15216 100644 --- a/app/code/Magento/Sitemap/Model/Resource/Catalog/Product.php +++ b/app/code/Magento/Sitemap/Model/Resource/Catalog/Product.php @@ -84,6 +84,7 @@ class Product extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param \Magento\Sitemap\Helper\Data $sitemapData * @param \Magento\Catalog\Model\Resource\Product $productResource * @param \Magento\Framework\Store\StoreManagerInterface $storeManager @@ -95,6 +96,7 @@ class Product extends \Magento\Framework\Model\Resource\Db\AbstractDb */ public function __construct( \Magento\Framework\App\Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, \Magento\Sitemap\Helper\Data $sitemapData, \Magento\Catalog\Model\Resource\Product $productResource, \Magento\Framework\Store\StoreManagerInterface $storeManager, @@ -112,7 +114,7 @@ public function __construct( $this->_eavConfigFactory = $eavConfigFactory; $this->_mediaConfig = $mediaConfig; $this->_sitemapData = $sitemapData; - parent::__construct($resource); + parent::__construct($resource, $objectRelationProcessor); } /** diff --git a/app/code/Magento/Tax/Model/Resource/Calculation.php b/app/code/Magento/Tax/Model/Resource/Calculation.php index bbaf80242bfd4..2025b46dc5f00 100644 --- a/app/code/Magento/Tax/Model/Resource/Calculation.php +++ b/app/code/Magento/Tax/Model/Resource/Calculation.php @@ -45,17 +45,19 @@ class Calculation extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\Framework\Store\StoreManagerInterface $storeManager */ public function __construct( \Magento\Framework\App\Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, \Magento\Tax\Helper\Data $taxData, \Magento\Framework\Store\StoreManagerInterface $storeManager ) { $this->_taxData = $taxData; $this->_storeManager = $storeManager; - parent::__construct($resource); + parent::__construct($resource, $objectRelationProcessor); } /** diff --git a/app/code/Magento/Tax/Model/Resource/Report/Tax.php b/app/code/Magento/Tax/Model/Resource/Report/Tax.php index 7b0e847ff4ea0..9ec166af18523 100644 --- a/app/code/Magento/Tax/Model/Resource/Report/Tax.php +++ b/app/code/Magento/Tax/Model/Resource/Report/Tax.php @@ -23,6 +23,7 @@ class Tax extends \Magento\Reports\Model\Resource\Report\AbstractReport /** * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate * @param \Magento\Reports\Model\FlagFactory $reportsFlagFactory @@ -33,6 +34,7 @@ class Tax extends \Magento\Reports\Model\Resource\Report\AbstractReport */ public function __construct( \Magento\Framework\App\Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, \Psr\Log\LoggerInterface $logger, \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate, \Magento\Reports\Model\FlagFactory $reportsFlagFactory, @@ -43,7 +45,15 @@ public function __construct( ) { $this->_createdAtFactory = $createdAtFactory; $this->_updatedAtFactory = $updatedAtFactory; - parent::__construct($resource, $logger, $localeDate, $reportsFlagFactory, $dateTime, $timezoneValidator); + parent::__construct( + $resource, + $objectRelationProcessor, + $logger, + $localeDate, + $reportsFlagFactory, + $dateTime, + $timezoneValidator + ); } /** diff --git a/app/code/Magento/Theme/Model/Resource/Design.php b/app/code/Magento/Theme/Model/Resource/Design.php index 169e5eae8b641..af1212ef4a4dc 100644 --- a/app/code/Magento/Theme/Model/Resource/Design.php +++ b/app/code/Magento/Theme/Model/Resource/Design.php @@ -23,12 +23,16 @@ class Design extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param DateTime $dateTime */ - public function __construct(\Magento\Framework\App\Resource $resource, DateTime $dateTime) - { + public function __construct( + \Magento\Framework\App\Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + DateTime $dateTime + ) { $this->dateTime = $dateTime; - parent::__construct($resource); + parent::__construct($resource, $objectRelationProcessor); } /** diff --git a/app/code/Magento/Translation/Model/Resource/String.php b/app/code/Magento/Translation/Model/Resource/String.php index c620c322528f2..3aca226f31d59 100644 --- a/app/code/Magento/Translation/Model/Resource/String.php +++ b/app/code/Magento/Translation/Model/Resource/String.php @@ -24,12 +24,14 @@ class String extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param \Magento\Framework\Locale\ResolverInterface $localeResolver * @param \Magento\Framework\App\ScopeResolverInterface $scopeResolver * @param string|null $scope */ public function __construct( \Magento\Framework\App\Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, \Magento\Framework\Locale\ResolverInterface $localeResolver, \Magento\Framework\App\ScopeResolverInterface $scopeResolver, $scope = null @@ -37,7 +39,7 @@ public function __construct( $this->_localeResolver = $localeResolver; $this->scopeResolver = $scopeResolver; $this->scope = $scope; - parent::__construct($resource); + parent::__construct($resource, $objectRelationProcessor); } /** diff --git a/app/code/Magento/Translation/Model/Resource/Translate.php b/app/code/Magento/Translation/Model/Resource/Translate.php index b670825e370ba..6d0cf41dd95cb 100644 --- a/app/code/Magento/Translation/Model/Resource/Translate.php +++ b/app/code/Magento/Translation/Model/Resource/Translate.php @@ -20,17 +20,19 @@ class Translate extends \Magento\Framework\Model\Resource\Db\AbstractDb implemen /** * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param \Magento\Framework\App\ScopeResolverInterface $scopeResolver * @param null|string $scope */ public function __construct( \Magento\Framework\App\Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, \Magento\Framework\App\ScopeResolverInterface $scopeResolver, $scope = null ) { $this->scopeResolver = $scopeResolver; $this->scope = $scope; - parent::__construct($resource); + parent::__construct($resource, $objectRelationProcessor); } /** diff --git a/app/code/Magento/User/Model/Resource/User.php b/app/code/Magento/User/Model/Resource/User.php index a25b0836d6973..9bcbb25b2f1c9 100644 --- a/app/code/Magento/User/Model/Resource/User.php +++ b/app/code/Magento/User/Model/Resource/User.php @@ -47,17 +47,19 @@ class User extends \Magento\Framework\Model\Resource\Db\AbstractDb * Construct * * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param \Magento\Framework\Acl\CacheInterface $aclCache * @param \Magento\Authorization\Model\RoleFactory $roleFactory * @param \Magento\Framework\Stdlib\DateTime $dateTime */ public function __construct( \Magento\Framework\App\Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, \Magento\Framework\Acl\CacheInterface $aclCache, \Magento\Authorization\Model\RoleFactory $roleFactory, \Magento\Framework\Stdlib\DateTime $dateTime ) { - parent::__construct($resource); + parent::__construct($resource, $objectRelationProcessor); $this->_aclCache = $aclCache; $this->_roleFactory = $roleFactory; $this->dateTime = $dateTime; diff --git a/app/code/Magento/Weee/Model/Resource/Attribute/Backend/Weee/Tax.php b/app/code/Magento/Weee/Model/Resource/Attribute/Backend/Weee/Tax.php index eeae9174af042..3e90a01ee225f 100644 --- a/app/code/Magento/Weee/Model/Resource/Attribute/Backend/Weee/Tax.php +++ b/app/code/Magento/Weee/Model/Resource/Attribute/Backend/Weee/Tax.php @@ -19,14 +19,16 @@ class Tax extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param \Magento\Framework\Store\StoreManagerInterface $storeManager */ public function __construct( \Magento\Framework\App\Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, \Magento\Framework\Store\StoreManagerInterface $storeManager ) { $this->_storeManager = $storeManager; - parent::__construct($resource); + parent::__construct($resource, $objectRelationProcessor); } /** diff --git a/app/code/Magento/Weee/Model/Resource/Tax.php b/app/code/Magento/Weee/Model/Resource/Tax.php index 54386958b5290..ace1bebf1638a 100644 --- a/app/code/Magento/Weee/Model/Resource/Tax.php +++ b/app/code/Magento/Weee/Model/Resource/Tax.php @@ -20,12 +20,16 @@ class Tax extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param \Magento\Framework\Stdlib\DateTime $dateTime */ - public function __construct(\Magento\Framework\App\Resource $resource, \Magento\Framework\Stdlib\DateTime $dateTime) - { + public function __construct( + \Magento\Framework\App\Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Stdlib\DateTime $dateTime + ) { $this->dateTime = $dateTime; - parent::__construct($resource); + parent::__construct($resource, $objectRelationProcessor); } /** diff --git a/lib/internal/Magento/Framework/Model/Resource/Db/AbstractDb.php b/lib/internal/Magento/Framework/Model/Resource/Db/AbstractDb.php index 956b054a2adb5..15cbd86ff0969 100644 --- a/lib/internal/Magento/Framework/Model/Resource/Db/AbstractDb.php +++ b/lib/internal/Magento/Framework/Model/Resource/Db/AbstractDb.php @@ -124,9 +124,12 @@ abstract class AbstractDb extends \Magento\Framework\Model\Resource\AbstractReso * Class constructor * * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor */ - public function __construct(\Magento\Framework\App\Resource $resource) - { + public function __construct( + \Magento\Framework\App\Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + ) { $this->_resources = $resource; parent::__construct(); } diff --git a/lib/internal/Magento/Framework/Model/Resource/Db/ObjectRelationProcessor.php b/lib/internal/Magento/Framework/Model/Resource/Db/ObjectRelationProcessor.php index 32d3227c535e4..11e00d1e77066 100644 --- a/lib/internal/Magento/Framework/Model/Resource/Db/ObjectRelationProcessor.php +++ b/lib/internal/Magento/Framework/Model/Resource/Db/ObjectRelationProcessor.php @@ -47,4 +47,17 @@ public function rollBack() { $this->connection->rollBack(); } + + /** + * Validate data that is about to be saved. Check that referenced entity(s) exists. + * + * @param string $table + * @param array $involvedData + * @return void + * @throws \LogicException + */ + public function validate($table, array $involvedData) + { + + } } From 44a770553042680888060cb64da50682b07067d9 Mon Sep 17 00:00:00 2001 From: Iryna Lagno Date: Thu, 5 Feb 2015 18:31:28 +0200 Subject: [PATCH 11/44] MAGETWO-32974: DB Foreign Keys Management on the Application Level - injected object relation processor to class constructors --- app/code/Magento/Authorization/Model/Resource/Role.php | 4 +++- app/code/Magento/Authorization/Model/Resource/Rules.php | 4 +++- app/code/Magento/Bundle/Model/Resource/Bundle.php | 4 +++- app/code/Magento/Bundle/Model/Resource/Option.php | 4 +++- app/code/Magento/Captcha/Model/Resource/Log.php | 4 +++- app/code/Magento/Catalog/Model/Resource/Attribute.php | 4 +++- app/code/Magento/Catalog/Model/Resource/Category/Flat.php | 6 ++++-- app/code/Magento/Catalog/Model/Resource/Config.php | 4 +++- .../Magento/Catalog/Model/Resource/Layer/Filter/Price.php | 4 +++- app/code/Magento/Catalog/Model/Resource/Product/Flat.php | 4 +++- .../Model/Resource/Indexer/Stock/DefaultStock.php | 4 +++- app/code/Magento/CatalogInventory/Model/Resource/Stock.php | 4 +++- .../Magento/CatalogInventory/Model/Resource/Stock/Item.php | 5 ++++- .../CatalogInventory/Model/Resource/Stock/Status.php | 4 +++- app/code/Magento/CatalogRule/Model/Resource/Rule.php | 4 +++- app/code/Magento/CatalogSearch/Model/Resource/Advanced.php | 4 +++- app/code/Magento/CatalogSearch/Model/Resource/Engine.php | 6 ++++-- app/code/Magento/CatalogSearch/Model/Resource/Fulltext.php | 4 +++- 18 files changed, 57 insertions(+), 20 deletions(-) diff --git a/app/code/Magento/Authorization/Model/Resource/Role.php b/app/code/Magento/Authorization/Model/Resource/Role.php index e1bd73002af02..7ce1dfd6c8ef3 100644 --- a/app/code/Magento/Authorization/Model/Resource/Role.php +++ b/app/code/Magento/Authorization/Model/Resource/Role.php @@ -33,16 +33,18 @@ class Role extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param \Magento\Framework\App\CacheInterface $cache * @param \Magento\Framework\Stdlib\DateTime $dateTime */ public function __construct( \Magento\Framework\App\Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, \Magento\Framework\App\CacheInterface $cache, \Magento\Framework\Stdlib\DateTime $dateTime ) { $this->dateTime = $dateTime; - parent::__construct($resource); + parent::__construct($resource, $objectRelationProcessor); $this->_cache = $cache->getFrontend(); } diff --git a/app/code/Magento/Authorization/Model/Resource/Rules.php b/app/code/Magento/Authorization/Model/Resource/Rules.php index 5e08f0a6cac10..40b44a171b6fe 100644 --- a/app/code/Magento/Authorization/Model/Resource/Rules.php +++ b/app/code/Magento/Authorization/Model/Resource/Rules.php @@ -39,6 +39,7 @@ class Rules extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param \Magento\Framework\Acl\Builder $aclBuilder * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Acl\RootResource $rootResource @@ -46,13 +47,14 @@ class Rules extends \Magento\Framework\Model\Resource\Db\AbstractDb */ public function __construct( \Magento\Framework\App\Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, \Magento\Framework\Acl\Builder $aclBuilder, \Psr\Log\LoggerInterface $logger, \Magento\Framework\Acl\RootResource $rootResource, \Magento\Framework\Acl\CacheInterface $aclCache ) { $this->_aclBuilder = $aclBuilder; - parent::__construct($resource); + parent::__construct($resource, $objectRelationProcessor); $this->_rootResource = $rootResource; $this->_aclCache = $aclCache; $this->_logger = $logger; diff --git a/app/code/Magento/Bundle/Model/Resource/Bundle.php b/app/code/Magento/Bundle/Model/Resource/Bundle.php index 7a6b0d006ac6a..972a27e0871e3 100644 --- a/app/code/Magento/Bundle/Model/Resource/Bundle.php +++ b/app/code/Magento/Bundle/Model/Resource/Bundle.php @@ -19,13 +19,15 @@ class Bundle extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param \Magento\Catalog\Model\Resource\Product\Relation $productRelation */ public function __construct( \Magento\Framework\App\Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, \Magento\Catalog\Model\Resource\Product\Relation $productRelation ) { - parent::__construct($resource); + parent::__construct($resource, $objectRelationProcessor); $this->_productRelation = $productRelation; } diff --git a/app/code/Magento/Bundle/Model/Resource/Option.php b/app/code/Magento/Bundle/Model/Resource/Option.php index 6e7b744f1d32a..74c4e9828114b 100644 --- a/app/code/Magento/Bundle/Model/Resource/Option.php +++ b/app/code/Magento/Bundle/Model/Resource/Option.php @@ -19,13 +19,15 @@ class Option extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param \Magento\Bundle\Model\Option\Validator $validator */ public function __construct( \Magento\Framework\App\Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, \Magento\Bundle\Model\Option\Validator $validator ) { - parent::__construct($resource); + parent::__construct($resource, $objectRelationProcessor); $this->validator = $validator; } diff --git a/app/code/Magento/Captcha/Model/Resource/Log.php b/app/code/Magento/Captcha/Model/Resource/Log.php index 11647904b6f65..854661fc05705 100644 --- a/app/code/Magento/Captcha/Model/Resource/Log.php +++ b/app/code/Magento/Captcha/Model/Resource/Log.php @@ -36,17 +36,19 @@ class Log extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param \Magento\Framework\Stdlib\DateTime\DateTime $coreDate * @param \Magento\Framework\HTTP\PhpEnvironment\RemoteAddress $remoteAddress */ public function __construct( \Magento\Framework\App\Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, \Magento\Framework\Stdlib\DateTime\DateTime $coreDate, \Magento\Framework\HTTP\PhpEnvironment\RemoteAddress $remoteAddress ) { $this->_coreDate = $coreDate; $this->_remoteAddress = $remoteAddress; - parent::__construct($resource); + parent::__construct($resource, $objectRelationProcessor); } /** diff --git a/app/code/Magento/Catalog/Model/Resource/Attribute.php b/app/code/Magento/Catalog/Model/Resource/Attribute.php index 21813424a1193..f5d465b487dee 100644 --- a/app/code/Magento/Catalog/Model/Resource/Attribute.php +++ b/app/code/Magento/Catalog/Model/Resource/Attribute.php @@ -28,6 +28,7 @@ class Attribute extends \Magento\Eav\Model\Resource\Entity\Attribute /** * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param \Magento\Framework\Store\StoreManagerInterface $storeManager * @param \Magento\Eav\Model\Resource\Entity\Type $eavEntityType * @param \Magento\Eav\Model\Config $eavConfig @@ -35,6 +36,7 @@ class Attribute extends \Magento\Eav\Model\Resource\Entity\Attribute */ public function __construct( \Magento\Framework\App\Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, \Magento\Framework\Store\StoreManagerInterface $storeManager, \Magento\Eav\Model\Resource\Entity\Type $eavEntityType, \Magento\Eav\Model\Config $eavConfig, @@ -42,7 +44,7 @@ public function __construct( ) { $this->attrLockValidator = $lockValidator; $this->_eavConfig = $eavConfig; - parent::__construct($resource, $storeManager, $eavEntityType); + parent::__construct($resource, $objectRelationProcessor, $storeManager, $eavEntityType); } /** diff --git a/app/code/Magento/Catalog/Model/Resource/Category/Flat.php b/app/code/Magento/Catalog/Model/Resource/Category/Flat.php index 95227879e5cbb..eff3e0f080f33 100644 --- a/app/code/Magento/Catalog/Model/Resource/Category/Flat.php +++ b/app/code/Magento/Catalog/Model/Resource/Category/Flat.php @@ -79,14 +79,16 @@ class Flat extends \Magento\Indexer\Model\Resource\AbstractResource /** * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param \Magento\Catalog\Model\CategoryFactory $categoryFactory - * @param \Magento\Catalog\Model\Resource\Category\CollectionFactory $categoryCollectionFactory + * @param CollectionFactory $categoryCollectionFactory * @param \Magento\Framework\Store\StoreManagerInterface $storeManager * @param \Magento\Catalog\Model\Config $catalogConfig * @param \Magento\Framework\Event\ManagerInterface $eventManager */ public function __construct( \Magento\Framework\App\Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, \Magento\Catalog\Model\CategoryFactory $categoryFactory, \Magento\Catalog\Model\Resource\Category\CollectionFactory $categoryCollectionFactory, \Magento\Framework\Store\StoreManagerInterface $storeManager, @@ -98,7 +100,7 @@ public function __construct( $this->_storeManager = $storeManager; $this->_catalogConfig = $catalogConfig; $this->_eventManager = $eventManager; - parent::__construct($resource); + parent::__construct($resource, $objectRelationProcessor); } /** diff --git a/app/code/Magento/Catalog/Model/Resource/Config.php b/app/code/Magento/Catalog/Model/Resource/Config.php index 1a650c5c7f09b..061255af1c9ec 100644 --- a/app/code/Magento/Catalog/Model/Resource/Config.php +++ b/app/code/Magento/Catalog/Model/Resource/Config.php @@ -42,17 +42,19 @@ class Config extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param \Magento\Framework\Store\StoreManagerInterface $storeManager * @param \Magento\Eav\Model\Config $eavConfig */ public function __construct( \Magento\Framework\App\Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, \Magento\Framework\Store\StoreManagerInterface $storeManager, \Magento\Eav\Model\Config $eavConfig ) { $this->_storeManager = $storeManager; $this->_eavConfig = $eavConfig; - parent::__construct($resource); + parent::__construct($resource, $objectRelationProcessor); } /** diff --git a/app/code/Magento/Catalog/Model/Resource/Layer/Filter/Price.php b/app/code/Magento/Catalog/Model/Resource/Layer/Filter/Price.php index fdcc55de263dd..ee67d9cfc7574 100644 --- a/app/code/Magento/Catalog/Model/Resource/Layer/Filter/Price.php +++ b/app/code/Magento/Catalog/Model/Resource/Layer/Filter/Price.php @@ -39,6 +39,7 @@ class Price extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Catalog\Model\Layer\Resolver $layerResolver * @param \Magento\Customer\Model\Session $session @@ -46,6 +47,7 @@ class Price extends \Magento\Framework\Model\Resource\Db\AbstractDb */ public function __construct( \Magento\Framework\App\Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Catalog\Model\Layer\Resolver $layerResolver, \Magento\Customer\Model\Session $session, @@ -55,7 +57,7 @@ public function __construct( $this->session = $session; $this->storeManager = $storeManager; $this->_eventManager = $eventManager; - parent::__construct($resource); + parent::__construct($resource, $objectRelationProcessor); } /** diff --git a/app/code/Magento/Catalog/Model/Resource/Product/Flat.php b/app/code/Magento/Catalog/Model/Resource/Product/Flat.php index ecdac4c6c4ee8..c24f3f3c9b233 100644 --- a/app/code/Magento/Catalog/Model/Resource/Product/Flat.php +++ b/app/code/Magento/Catalog/Model/Resource/Product/Flat.php @@ -37,17 +37,19 @@ class Flat extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param \Magento\Framework\Store\StoreManagerInterface $storeManager * @param \Magento\Catalog\Model\Config $catalogConfig */ public function __construct( \Magento\Framework\App\Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, \Magento\Framework\Store\StoreManagerInterface $storeManager, \Magento\Catalog\Model\Config $catalogConfig ) { $this->_storeManager = $storeManager; $this->_catalogConfig = $catalogConfig; - parent::__construct($resource); + parent::__construct($resource, $objectRelationProcessor); } /** diff --git a/app/code/Magento/CatalogInventory/Model/Resource/Indexer/Stock/DefaultStock.php b/app/code/Magento/CatalogInventory/Model/Resource/Indexer/Stock/DefaultStock.php index 9699aa3e98b36..7c82377575e70 100644 --- a/app/code/Magento/CatalogInventory/Model/Resource/Indexer/Stock/DefaultStock.php +++ b/app/code/Magento/CatalogInventory/Model/Resource/Indexer/Stock/DefaultStock.php @@ -36,16 +36,18 @@ class DefaultStock extends \Magento\Catalog\Model\Resource\Product\Indexer\Abstr * Class constructor * * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig */ public function __construct( \Magento\Framework\App\Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, \Magento\Eav\Model\Config $eavConfig, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig ) { $this->_scopeConfig = $scopeConfig; - parent::__construct($resource, $eavConfig); + parent::__construct($resource, $objectRelationProcessor, $eavConfig); } /** diff --git a/app/code/Magento/CatalogInventory/Model/Resource/Stock.php b/app/code/Magento/CatalogInventory/Model/Resource/Stock.php index 25d8f752f5a42..a1388f4c4b3d2 100644 --- a/app/code/Magento/CatalogInventory/Model/Resource/Stock.php +++ b/app/code/Magento/CatalogInventory/Model/Resource/Stock.php @@ -80,6 +80,7 @@ class Stock extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Framework\Stdlib\DateTime $dateTime * @param StockConfigurationInterface $stockConfiguration @@ -87,12 +88,13 @@ class Stock extends \Magento\Framework\Model\Resource\Db\AbstractDb */ public function __construct( \Magento\Framework\App\Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Framework\Stdlib\DateTime $dateTime, StockConfigurationInterface $stockConfiguration, StoreManagerInterface $storeManager ) { - parent::__construct($resource); + parent::__construct($resource, $objectRelationProcessor); $this->_scopeConfig = $scopeConfig; $this->dateTime = $dateTime; $this->stockConfiguration = $stockConfiguration; diff --git a/app/code/Magento/CatalogInventory/Model/Resource/Stock/Item.php b/app/code/Magento/CatalogInventory/Model/Resource/Stock/Item.php index d288b95a6eae7..cdb7be49e3676 100644 --- a/app/code/Magento/CatalogInventory/Model/Resource/Stock/Item.php +++ b/app/code/Magento/CatalogInventory/Model/Resource/Stock/Item.php @@ -9,6 +9,7 @@ use Magento\CatalogInventory\Model\Indexer\Stock\Processor; use Magento\Framework\App\Resource as AppResource; use Magento\Framework\Model\AbstractModel; +use Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface; /** * Stock item resource model @@ -29,14 +30,16 @@ class Item extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param AppResource $resource + * @param ObjectRelationProcessorInterface $objectRelationProcessor * @param Processor $processor */ public function __construct( AppResource $resource, + ObjectRelationProcessorInterface $objectRelationProcessor, Processor $processor ) { $this->stockIndexerProcessor = $processor; - parent::__construct($resource); + parent::__construct($resource, $objectRelationProcessor); } /** diff --git a/app/code/Magento/CatalogInventory/Model/Resource/Stock/Status.php b/app/code/Magento/CatalogInventory/Model/Resource/Stock/Status.php index ff68cf46fb9dc..d68b6adc6dd21 100644 --- a/app/code/Magento/CatalogInventory/Model/Resource/Stock/Status.php +++ b/app/code/Magento/CatalogInventory/Model/Resource/Stock/Status.php @@ -33,17 +33,19 @@ class Status extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param \Magento\Framework\Store\StoreManagerInterface $storeManager * @param \Magento\Store\Model\WebsiteFactory $websiteFactory * @param \Magento\Eav\Model\Config $eavConfig */ public function __construct( \Magento\Framework\App\Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, \Magento\Framework\Store\StoreManagerInterface $storeManager, \Magento\Store\Model\WebsiteFactory $websiteFactory, \Magento\Eav\Model\Config $eavConfig ) { - parent::__construct($resource); + parent::__construct($resource, $objectRelationProcessor); $this->_storeManager = $storeManager; $this->_websiteFactory = $websiteFactory; diff --git a/app/code/Magento/CatalogRule/Model/Resource/Rule.php b/app/code/Magento/CatalogRule/Model/Resource/Rule.php index f9e6ee80903b4..0db9a5e10b400 100644 --- a/app/code/Magento/CatalogRule/Model/Resource/Rule.php +++ b/app/code/Magento/CatalogRule/Model/Resource/Rule.php @@ -94,6 +94,7 @@ class Rule extends \Magento\Rule\Model\Resource\AbstractResource /** * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param \Magento\Framework\Store\StoreManagerInterface $storeManager * @param Product\ConditionFactory $conditionFactory * @param \Magento\Framework\Stdlib\DateTime\DateTime $coreDate @@ -107,6 +108,7 @@ class Rule extends \Magento\Rule\Model\Resource\AbstractResource */ public function __construct( \Magento\Framework\App\Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, \Magento\Framework\Store\StoreManagerInterface $storeManager, \Magento\Catalog\Model\Product\ConditionFactory $conditionFactory, \Magento\Framework\Stdlib\DateTime\DateTime $coreDate, @@ -126,7 +128,7 @@ public function __construct( $this->_logger = $logger; $this->dateTime = $dateTime; $this->priceCurrency = $priceCurrency; - parent::__construct($resource); + parent::__construct($resource, $objectRelationProcessor); } /** diff --git a/app/code/Magento/CatalogSearch/Model/Resource/Advanced.php b/app/code/Magento/CatalogSearch/Model/Resource/Advanced.php index 2227c8bfa7cf2..d8c383eeb9c6f 100644 --- a/app/code/Magento/CatalogSearch/Model/Resource/Advanced.php +++ b/app/code/Magento/CatalogSearch/Model/Resource/Advanced.php @@ -30,17 +30,19 @@ class Advanced extends \Magento\Framework\Model\Resource\Db\AbstractDb * Construct * * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param \Magento\Framework\Store\StoreManagerInterface $storeManager * @param \Magento\Framework\Event\ManagerInterface $eventManager */ public function __construct( \Magento\Framework\App\Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, \Magento\Framework\Store\StoreManagerInterface $storeManager, \Magento\Framework\Event\ManagerInterface $eventManager ) { $this->_storeManager = $storeManager; $this->_eventManager = $eventManager; - parent::__construct($resource); + parent::__construct($resource, $objectRelationProcessor); } /** diff --git a/app/code/Magento/CatalogSearch/Model/Resource/Engine.php b/app/code/Magento/CatalogSearch/Model/Resource/Engine.php index 51b4a57f60974..4601aad805e87 100644 --- a/app/code/Magento/CatalogSearch/Model/Resource/Engine.php +++ b/app/code/Magento/CatalogSearch/Model/Resource/Engine.php @@ -48,13 +48,15 @@ class Engine extends AbstractDb implements EngineInterface * Construct * * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param \Magento\Catalog\Model\Product\Visibility $catalogProductVisibility - * @param \Magento\CatalogSearch\Model\Resource\Advanced $searchResource + * @param Advanced $searchResource * @param \Magento\CatalogSearch\Helper\Data $catalogSearchData * @param \Magento\Search\Model\Resource\Helper $resourceHelper */ public function __construct( \Magento\Framework\App\Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, \Magento\Catalog\Model\Product\Visibility $catalogProductVisibility, \Magento\CatalogSearch\Model\Resource\Advanced $searchResource, \Magento\CatalogSearch\Helper\Data $catalogSearchData, @@ -64,7 +66,7 @@ public function __construct( $this->_searchResource = $searchResource; $this->_catalogSearchData = $catalogSearchData; $this->_resourceHelper = $resourceHelper; - parent::__construct($resource); + parent::__construct($resource, $objectRelationProcessor); } /** diff --git a/app/code/Magento/CatalogSearch/Model/Resource/Fulltext.php b/app/code/Magento/CatalogSearch/Model/Resource/Fulltext.php index 1f47cdd3e7a60..026fd76e8ea4f 100644 --- a/app/code/Magento/CatalogSearch/Model/Resource/Fulltext.php +++ b/app/code/Magento/CatalogSearch/Model/Resource/Fulltext.php @@ -35,12 +35,14 @@ class Fulltext extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Framework\Filter\FilterManager $filter * @param Helper $resourceHelper */ public function __construct( \Magento\Framework\App\Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Framework\Filter\FilterManager $filter, \Magento\Search\Model\Resource\Helper $resourceHelper @@ -48,7 +50,7 @@ public function __construct( $this->_eventManager = $eventManager; $this->filter = $filter; $this->_resourceHelper = $resourceHelper; - parent::__construct($resource); + parent::__construct($resource, $objectRelationProcessor); } /** From 6e2bc44ee5cdd346be38fab331f9b164170e18ef Mon Sep 17 00:00:00 2001 From: Olexii Korshenko Date: Fri, 6 Feb 2015 11:28:04 +0200 Subject: [PATCH 12/44] MAGETWO-32974: DB Foreign Keys Management on the Application Level --- lib/internal/Magento/Framework/Model/Resource/Db/AbstractDb.php | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/internal/Magento/Framework/Model/Resource/Db/AbstractDb.php b/lib/internal/Magento/Framework/Model/Resource/Db/AbstractDb.php index 15cbd86ff0969..54dad176e3249 100644 --- a/lib/internal/Magento/Framework/Model/Resource/Db/AbstractDb.php +++ b/lib/internal/Magento/Framework/Model/Resource/Db/AbstractDb.php @@ -130,6 +130,7 @@ public function __construct( \Magento\Framework\App\Resource $resource, \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor ) { + $this->relationProcessor = $objectRelationProcessor; $this->_resources = $resource; parent::__construct(); } From 5708a9d14e933fcc01b8b38cd120ca0cf2d5711b Mon Sep 17 00:00:00 2001 From: Olexii Korshenko Date: Fri, 6 Feb 2015 11:52:53 +0200 Subject: [PATCH 13/44] MAGETWO-32974: DB Foreign Keys Management on the Application Level - fixed setup tool logic --- setup/module/Magento/Setup/src/Module/SetupFactory.php | 3 ++- setup/module/Magento/Setup/src/Module/SetupModule.php | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/setup/module/Magento/Setup/src/Module/SetupFactory.php b/setup/module/Magento/Setup/src/Module/SetupFactory.php index 8ce8840fea1d9..e881e7c2125b9 100644 --- a/setup/module/Magento/Setup/src/Module/SetupFactory.php +++ b/setup/module/Magento/Setup/src/Module/SetupFactory.php @@ -59,7 +59,8 @@ public function createSetupModule(LoggerInterface $log, $moduleName) $this->serviceLocator->get('Magento\Framework\Module\ModuleList'), $this->serviceLocator->get('Magento\Setup\Module\Setup\FileResolver'), $moduleName, - $this->getResource() + $this->getResource(), + $this->serviceLocator->get('Magento\Framework\Model\Resource\Db\ObjectRelationProcessor') ); } diff --git a/setup/module/Magento/Setup/src/Module/SetupModule.php b/setup/module/Magento/Setup/src/Module/SetupModule.php index a884ff4a3b438..9270f415c06ce 100644 --- a/setup/module/Magento/Setup/src/Module/SetupModule.php +++ b/setup/module/Magento/Setup/src/Module/SetupModule.php @@ -59,6 +59,7 @@ class SetupModule extends Setup * @param SetupFileResolver $fileResolver * @param string $moduleName * @param \Magento\Framework\App\Resource $resource + * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor * @param string $connectionName */ public function __construct( @@ -67,13 +68,14 @@ public function __construct( SetupFileResolver $fileResolver, $moduleName, \Magento\Framework\App\Resource $resource, + \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, $connectionName = SetupInterface::DEFAULT_SETUP_CONNECTION ) { parent::__construct($resource, $connectionName); $this->logger = $log; $this->fileResolver = $fileResolver; $this->moduleConfig = $moduleList->getOne($moduleName); - $this->resource = new Resource($resource); + $this->resource = new Resource($resource, $objectRelationProcessor); $this->resourceName = $this->fileResolver->getResourceCode($moduleName); } From f617075f9d89850cda6fb87526c8a24d8a5112ef Mon Sep 17 00:00:00 2001 From: Alex Akimov Date: Fri, 6 Feb 2015 12:06:40 +0200 Subject: [PATCH 14/44] MAGETWO-33650: Validation of Constraint before Model Save --- lib/internal/Magento/Framework/Model/Resource/Db/AbstractDb.php | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/internal/Magento/Framework/Model/Resource/Db/AbstractDb.php b/lib/internal/Magento/Framework/Model/Resource/Db/AbstractDb.php index 54dad176e3249..b84790551ac03 100644 --- a/lib/internal/Magento/Framework/Model/Resource/Db/AbstractDb.php +++ b/lib/internal/Magento/Framework/Model/Resource/Db/AbstractDb.php @@ -398,6 +398,7 @@ public function save(\Magento\Framework\Model\AbstractModel $object) $object->beforeSave(); if ($object->isSaveAllowed()) { $this->_serializeFields($object); + $this->relationProcessor->validate($this->getMainTable(), $object->getData()); $this->_beforeSave($object); $this->_checkUnique($object); if (!is_null($object->getId()) && (!$this->_useIsObjectNew || !$object->isObjectNew())) { From 6aa982e8100bd66dbaef18cfa46fa5839292ce16 Mon Sep 17 00:00:00 2001 From: Olexii Korshenko Date: Fri, 6 Feb 2015 14:51:37 +0200 Subject: [PATCH 15/44] MAGETWO-32974: DB Foreign Keys Management on the Application Level --- .../Authorization/Model/Resource/Role.php | 6 +- .../Authorization/Model/Resource/Rules.php | 6 +- .../Magento/Bundle/Model/Resource/Bundle.php | 6 +- .../Magento/Bundle/Model/Resource/Option.php | 6 +- .../Magento/Captcha/Model/Resource/Log.php | 6 +- .../Catalog/Model/Resource/Attribute.php | 6 +- .../Catalog/Model/Resource/Category/Flat.php | 6 +- .../Magento/Catalog/Model/Resource/Config.php | 6 +- .../Model/Resource/Layer/Filter/Price.php | 6 +- .../Catalog/Model/Resource/Product/Flat.php | 6 +- .../Product/Indexer/AbstractIndexer.php | 6 +- .../Product/Indexer/Eav/AbstractEav.php | 6 +- .../Resource/Product/Indexer/Eav/Source.php | 6 +- .../Product/Indexer/Price/DefaultPrice.php | 6 +- .../Catalog/Model/Resource/Product/Link.php | 6 +- .../Catalog/Model/Resource/Product/Option.php | 6 +- .../Model/Resource/Product/Option/Value.php | 6 +- .../Model/Resource/Product/Website.php | 6 +- .../Magento/Catalog/Model/Resource/Url.php | 6 +- .../Resource/Indexer/Stock/DefaultStock.php | 6 +- .../CatalogInventory/Model/Resource/Stock.php | 6 +- .../Model/Resource/Stock/Item.php | 8 +- .../Model/Resource/Stock/Status.php | 6 +- .../CatalogRule/Model/Resource/Rule.php | 6 +- .../CatalogSearch/Model/Resource/Advanced.php | 6 +- .../CatalogSearch/Model/Resource/Engine.php | 6 +- .../CatalogSearch/Model/Resource/Fulltext.php | 6 +- .../Model/Resource/Agreement.php | 6 +- app/code/Magento/Cms/Model/Resource/Block.php | 6 +- app/code/Magento/Cms/Model/Resource/Page.php | 6 +- .../Resource/Product/Type/Configurable.php | 6 +- .../Product/Type/Configurable/Attribute.php | 6 +- .../Model/Resource/File/Storage/Database.php | 6 +- .../Core/Model/Resource/Layout/Update.php | 6 +- .../Magento/Customer/Model/Resource/Group.php | 6 +- .../Customer/Model/Resource/Visitor.php | 6 +- .../Import/CustomerComposite/Data.php | 6 +- .../Model/Theme/Resource/Change.php | 6 +- .../Directory/Model/Resource/Region.php | 6 +- .../Downloadable/Model/Resource/Link.php | 6 +- .../Eav/Model/Resource/Entity/Attribute.php | 6 +- .../Model/Resource/Entity/Attribute/Set.php | 6 +- .../Magento/Email/Model/Resource/Template.php | 6 +- .../Model/Resource/Import/Data.php | 6 +- .../Model/Resource/Oauth/Consumer.php | 6 +- .../Model/Resource/Oauth/Token.php | 6 +- app/code/Magento/Log/Model/Resource/Log.php | 6 +- .../Magento/Log/Model/Resource/Visitor.php | 6 +- .../Log/Model/Resource/Visitor/Online.php | 6 +- .../Newsletter/Model/Resource/Queue.php | 6 +- .../Newsletter/Model/Resource/Subscriber.php | 6 +- .../Newsletter/Model/Resource/Template.php | 6 +- .../Model/Resource/Carrier/Tablerate.php | 6 +- .../Persistent/Model/Resource/Session.php | 6 +- .../ProductAlert/Model/Resource/Price.php | 6 +- .../ProductAlert/Model/Resource/Stock.php | 6 +- .../Magento/Quote/Model/Resource/Quote.php | 6 +- .../Magento/Reports/Model/Resource/Event.php | 6 +- .../Resource/Product/Index/AbstractIndex.php | 6 +- .../Model/Resource/Report/AbstractReport.php | 6 +- .../Model/Resource/Report/Product/Viewed.php | 6 +- .../Magento/Review/Model/Resource/Rating.php | 6 +- .../Review/Model/Resource/Rating/Option.php | 6 +- .../Magento/Review/Model/Resource/Review.php | 6 +- .../Sales/Model/Resource/AbstractGrid.php | 6 +- .../Magento/Sales/Model/Resource/Entity.php | 6 +- .../Magento/Sales/Model/Resource/Order.php | 6 +- .../Sales/Model/Resource/Order/Address.php | 6 +- .../Sales/Model/Resource/Order/Creditmemo.php | 6 +- .../Resource/Order/Creditmemo/Comment.php | 6 +- .../Sales/Model/Resource/Order/Invoice.php | 6 +- .../Model/Resource/Order/Invoice/Comment.php | 6 +- .../Sales/Model/Resource/Order/Shipment.php | 6 +- .../Model/Resource/Order/Shipment/Comment.php | 6 +- .../Model/Resource/Order/Shipment/Track.php | 6 +- .../Sales/Model/Resource/Order/Status.php | 6 +- .../Model/Resource/Order/Status/History.php | 6 +- .../Model/Resource/Report/Bestsellers.php | 6 +- .../Sales/Model/Resource/Report/Order.php | 6 +- .../SalesRule/Model/Resource/Report/Rule.php | 6 +- .../Magento/SalesRule/Model/Resource/Rule.php | 6 +- .../Magento/Search/Model/Resource/Query.php | 6 +- .../Model/Resource/Catalog/Category.php | 6 +- .../Model/Resource/Catalog/Product.php | 6 +- .../Tax/Model/Resource/Calculation.php | 6 +- .../Magento/Tax/Model/Resource/Report/Tax.php | 6 +- .../Magento/Theme/Model/Resource/Design.php | 6 +- .../Translation/Model/Resource/String.php | 6 +- .../Translation/Model/Resource/Translate.php | 6 +- app/code/Magento/User/Model/Resource/User.php | 6 +- .../Resource/Attribute/Backend/Weee/Tax.php | 6 +- app/code/Magento/Weee/Model/Resource/Tax.php | 6 +- app/etc/di.xml | 4 +- .../Model/Resource/Db/AbstractDb.php | 35 +++++---- .../Resource/Db/ObjectRelationProcessor.php | 57 ++++---------- .../Model/Resource/Db/TransactionManager.php | 74 +++++++++++++++++++ ...ce.php => TransactionManagerInterface.php} | 12 ++- .../Magento/Setup/src/Module/SetupFactory.php | 2 +- .../Magento/Setup/src/Module/SetupModule.php | 6 +- 99 files changed, 402 insertions(+), 342 deletions(-) create mode 100644 lib/internal/Magento/Framework/Model/Resource/Db/TransactionManager.php rename lib/internal/Magento/Framework/Model/Resource/Db/{ObjectRelationProcessorInterface.php => TransactionManagerInterface.php} (80%) diff --git a/app/code/Magento/Authorization/Model/Resource/Role.php b/app/code/Magento/Authorization/Model/Resource/Role.php index 7ce1dfd6c8ef3..3c1a9311eef1c 100644 --- a/app/code/Magento/Authorization/Model/Resource/Role.php +++ b/app/code/Magento/Authorization/Model/Resource/Role.php @@ -33,18 +33,18 @@ class Role extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param \Magento\Framework\App\CacheInterface $cache * @param \Magento\Framework\Stdlib\DateTime $dateTime */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, \Magento\Framework\App\CacheInterface $cache, \Magento\Framework\Stdlib\DateTime $dateTime ) { $this->dateTime = $dateTime; - parent::__construct($resource, $objectRelationProcessor); + parent::__construct($resource, $transactionManager); $this->_cache = $cache->getFrontend(); } diff --git a/app/code/Magento/Authorization/Model/Resource/Rules.php b/app/code/Magento/Authorization/Model/Resource/Rules.php index 40b44a171b6fe..c5c2de299151f 100644 --- a/app/code/Magento/Authorization/Model/Resource/Rules.php +++ b/app/code/Magento/Authorization/Model/Resource/Rules.php @@ -39,7 +39,7 @@ class Rules extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param \Magento\Framework\Acl\Builder $aclBuilder * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Acl\RootResource $rootResource @@ -47,14 +47,14 @@ class Rules extends \Magento\Framework\Model\Resource\Db\AbstractDb */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, \Magento\Framework\Acl\Builder $aclBuilder, \Psr\Log\LoggerInterface $logger, \Magento\Framework\Acl\RootResource $rootResource, \Magento\Framework\Acl\CacheInterface $aclCache ) { $this->_aclBuilder = $aclBuilder; - parent::__construct($resource, $objectRelationProcessor); + parent::__construct($resource, $transactionManager); $this->_rootResource = $rootResource; $this->_aclCache = $aclCache; $this->_logger = $logger; diff --git a/app/code/Magento/Bundle/Model/Resource/Bundle.php b/app/code/Magento/Bundle/Model/Resource/Bundle.php index 972a27e0871e3..b6cc7c895646d 100644 --- a/app/code/Magento/Bundle/Model/Resource/Bundle.php +++ b/app/code/Magento/Bundle/Model/Resource/Bundle.php @@ -19,15 +19,15 @@ class Bundle extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param \Magento\Catalog\Model\Resource\Product\Relation $productRelation */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, \Magento\Catalog\Model\Resource\Product\Relation $productRelation ) { - parent::__construct($resource, $objectRelationProcessor); + parent::__construct($resource, $transactionManager); $this->_productRelation = $productRelation; } diff --git a/app/code/Magento/Bundle/Model/Resource/Option.php b/app/code/Magento/Bundle/Model/Resource/Option.php index 74c4e9828114b..9767d877f358a 100644 --- a/app/code/Magento/Bundle/Model/Resource/Option.php +++ b/app/code/Magento/Bundle/Model/Resource/Option.php @@ -19,15 +19,15 @@ class Option extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param \Magento\Bundle\Model\Option\Validator $validator */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, \Magento\Bundle\Model\Option\Validator $validator ) { - parent::__construct($resource, $objectRelationProcessor); + parent::__construct($resource, $transactionManager); $this->validator = $validator; } diff --git a/app/code/Magento/Captcha/Model/Resource/Log.php b/app/code/Magento/Captcha/Model/Resource/Log.php index 854661fc05705..94fb433a8cdb6 100644 --- a/app/code/Magento/Captcha/Model/Resource/Log.php +++ b/app/code/Magento/Captcha/Model/Resource/Log.php @@ -36,19 +36,19 @@ class Log extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param \Magento\Framework\Stdlib\DateTime\DateTime $coreDate * @param \Magento\Framework\HTTP\PhpEnvironment\RemoteAddress $remoteAddress */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, \Magento\Framework\Stdlib\DateTime\DateTime $coreDate, \Magento\Framework\HTTP\PhpEnvironment\RemoteAddress $remoteAddress ) { $this->_coreDate = $coreDate; $this->_remoteAddress = $remoteAddress; - parent::__construct($resource, $objectRelationProcessor); + parent::__construct($resource, $transactionManager); } /** diff --git a/app/code/Magento/Catalog/Model/Resource/Attribute.php b/app/code/Magento/Catalog/Model/Resource/Attribute.php index f5d465b487dee..b77c67a6e7798 100644 --- a/app/code/Magento/Catalog/Model/Resource/Attribute.php +++ b/app/code/Magento/Catalog/Model/Resource/Attribute.php @@ -28,7 +28,7 @@ class Attribute extends \Magento\Eav\Model\Resource\Entity\Attribute /** * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param \Magento\Framework\Store\StoreManagerInterface $storeManager * @param \Magento\Eav\Model\Resource\Entity\Type $eavEntityType * @param \Magento\Eav\Model\Config $eavConfig @@ -36,7 +36,7 @@ class Attribute extends \Magento\Eav\Model\Resource\Entity\Attribute */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, \Magento\Framework\Store\StoreManagerInterface $storeManager, \Magento\Eav\Model\Resource\Entity\Type $eavEntityType, \Magento\Eav\Model\Config $eavConfig, @@ -44,7 +44,7 @@ public function __construct( ) { $this->attrLockValidator = $lockValidator; $this->_eavConfig = $eavConfig; - parent::__construct($resource, $objectRelationProcessor, $storeManager, $eavEntityType); + parent::__construct($resource, $transactionManager, $storeManager, $eavEntityType); } /** diff --git a/app/code/Magento/Catalog/Model/Resource/Category/Flat.php b/app/code/Magento/Catalog/Model/Resource/Category/Flat.php index eff3e0f080f33..1db04885a960a 100644 --- a/app/code/Magento/Catalog/Model/Resource/Category/Flat.php +++ b/app/code/Magento/Catalog/Model/Resource/Category/Flat.php @@ -79,7 +79,7 @@ class Flat extends \Magento\Indexer\Model\Resource\AbstractResource /** * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param \Magento\Catalog\Model\CategoryFactory $categoryFactory * @param CollectionFactory $categoryCollectionFactory * @param \Magento\Framework\Store\StoreManagerInterface $storeManager @@ -88,7 +88,7 @@ class Flat extends \Magento\Indexer\Model\Resource\AbstractResource */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, \Magento\Catalog\Model\CategoryFactory $categoryFactory, \Magento\Catalog\Model\Resource\Category\CollectionFactory $categoryCollectionFactory, \Magento\Framework\Store\StoreManagerInterface $storeManager, @@ -100,7 +100,7 @@ public function __construct( $this->_storeManager = $storeManager; $this->_catalogConfig = $catalogConfig; $this->_eventManager = $eventManager; - parent::__construct($resource, $objectRelationProcessor); + parent::__construct($resource, $transactionManager); } /** diff --git a/app/code/Magento/Catalog/Model/Resource/Config.php b/app/code/Magento/Catalog/Model/Resource/Config.php index 061255af1c9ec..10e339209940f 100644 --- a/app/code/Magento/Catalog/Model/Resource/Config.php +++ b/app/code/Magento/Catalog/Model/Resource/Config.php @@ -42,19 +42,19 @@ class Config extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param \Magento\Framework\Store\StoreManagerInterface $storeManager * @param \Magento\Eav\Model\Config $eavConfig */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, \Magento\Framework\Store\StoreManagerInterface $storeManager, \Magento\Eav\Model\Config $eavConfig ) { $this->_storeManager = $storeManager; $this->_eavConfig = $eavConfig; - parent::__construct($resource, $objectRelationProcessor); + parent::__construct($resource, $transactionManager); } /** diff --git a/app/code/Magento/Catalog/Model/Resource/Layer/Filter/Price.php b/app/code/Magento/Catalog/Model/Resource/Layer/Filter/Price.php index ee67d9cfc7574..fcccb8629eb46 100644 --- a/app/code/Magento/Catalog/Model/Resource/Layer/Filter/Price.php +++ b/app/code/Magento/Catalog/Model/Resource/Layer/Filter/Price.php @@ -39,7 +39,7 @@ class Price extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Catalog\Model\Layer\Resolver $layerResolver * @param \Magento\Customer\Model\Session $session @@ -47,7 +47,7 @@ class Price extends \Magento\Framework\Model\Resource\Db\AbstractDb */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Catalog\Model\Layer\Resolver $layerResolver, \Magento\Customer\Model\Session $session, @@ -57,7 +57,7 @@ public function __construct( $this->session = $session; $this->storeManager = $storeManager; $this->_eventManager = $eventManager; - parent::__construct($resource, $objectRelationProcessor); + parent::__construct($resource, $transactionManager); } /** diff --git a/app/code/Magento/Catalog/Model/Resource/Product/Flat.php b/app/code/Magento/Catalog/Model/Resource/Product/Flat.php index c24f3f3c9b233..d8f2f6df99ed6 100644 --- a/app/code/Magento/Catalog/Model/Resource/Product/Flat.php +++ b/app/code/Magento/Catalog/Model/Resource/Product/Flat.php @@ -37,19 +37,19 @@ class Flat extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param \Magento\Framework\Store\StoreManagerInterface $storeManager * @param \Magento\Catalog\Model\Config $catalogConfig */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, \Magento\Framework\Store\StoreManagerInterface $storeManager, \Magento\Catalog\Model\Config $catalogConfig ) { $this->_storeManager = $storeManager; $this->_catalogConfig = $catalogConfig; - parent::__construct($resource, $objectRelationProcessor); + parent::__construct($resource, $transactionManager); } /** diff --git a/app/code/Magento/Catalog/Model/Resource/Product/Indexer/AbstractIndexer.php b/app/code/Magento/Catalog/Model/Resource/Product/Indexer/AbstractIndexer.php index 9177e9609f63f..55d7989e4fe59 100644 --- a/app/code/Magento/Catalog/Model/Resource/Product/Indexer/AbstractIndexer.php +++ b/app/code/Magento/Catalog/Model/Resource/Product/Indexer/AbstractIndexer.php @@ -23,16 +23,16 @@ abstract class AbstractIndexer extends \Magento\Indexer\Model\Resource\AbstractR * Class constructor * * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param \Magento\Eav\Model\Config $eavConfig */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, \Magento\Eav\Model\Config $eavConfig ) { $this->_eavConfig = $eavConfig; - parent::__construct($resource, $objectRelationProcessor); + parent::__construct($resource, $transactionManager); } /** diff --git a/app/code/Magento/Catalog/Model/Resource/Product/Indexer/Eav/AbstractEav.php b/app/code/Magento/Catalog/Model/Resource/Product/Indexer/Eav/AbstractEav.php index afb3b52ef53ae..a541551696f23 100644 --- a/app/code/Magento/Catalog/Model/Resource/Product/Indexer/Eav/AbstractEav.php +++ b/app/code/Magento/Catalog/Model/Resource/Product/Indexer/Eav/AbstractEav.php @@ -23,18 +23,18 @@ abstract class AbstractEav extends \Magento\Catalog\Model\Resource\Product\Index * Construct * * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\Framework\Event\ManagerInterface $eventManager */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, \Magento\Eav\Model\Config $eavConfig, \Magento\Framework\Event\ManagerInterface $eventManager ) { $this->_eventManager = $eventManager; - parent::__construct($resource, $objectRelationProcessor, $eavConfig); + parent::__construct($resource, $transactionManager, $eavConfig); } /** diff --git a/app/code/Magento/Catalog/Model/Resource/Product/Indexer/Eav/Source.php b/app/code/Magento/Catalog/Model/Resource/Product/Indexer/Eav/Source.php index 6fa2a1df54f7d..dd14390f604d4 100644 --- a/app/code/Magento/Catalog/Model/Resource/Product/Indexer/Eav/Source.php +++ b/app/code/Magento/Catalog/Model/Resource/Product/Indexer/Eav/Source.php @@ -25,20 +25,20 @@ class Source extends AbstractEav * Construct * * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Catalog\Model\Resource\Helper $resourceHelper */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, \Magento\Eav\Model\Config $eavConfig, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Catalog\Model\Resource\Helper $resourceHelper ) { $this->_resourceHelper = $resourceHelper; - parent::__construct($resource, $objectRelationProcessor, $eavConfig, $eventManager); + parent::__construct($resource, $transactionManager, $eavConfig, $eventManager); } /** diff --git a/app/code/Magento/Catalog/Model/Resource/Product/Indexer/Price/DefaultPrice.php b/app/code/Magento/Catalog/Model/Resource/Product/Indexer/Price/DefaultPrice.php index 07f5816509cd1..90f4f84403b68 100644 --- a/app/code/Magento/Catalog/Model/Resource/Product/Indexer/Price/DefaultPrice.php +++ b/app/code/Magento/Catalog/Model/Resource/Product/Indexer/Price/DefaultPrice.php @@ -43,21 +43,21 @@ class DefaultPrice extends \Magento\Catalog\Model\Resource\Product\Indexer\Abstr /** * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Framework\Module\Manager $moduleManager */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, \Magento\Eav\Model\Config $eavConfig, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Framework\Module\Manager $moduleManager ) { $this->_eventManager = $eventManager; $this->moduleManager = $moduleManager; - parent::__construct($resource, $objectRelationProcessor, $eavConfig); + parent::__construct($resource, $transactionManager, $eavConfig); } /** diff --git a/app/code/Magento/Catalog/Model/Resource/Product/Link.php b/app/code/Magento/Catalog/Model/Resource/Product/Link.php index f2c090429e2da..6e11f7aa548c6 100644 --- a/app/code/Magento/Catalog/Model/Resource/Product/Link.php +++ b/app/code/Magento/Catalog/Model/Resource/Product/Link.php @@ -28,16 +28,16 @@ class Link extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param Relation $catalogProductRelation */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, Relation $catalogProductRelation ) { $this->_catalogProductRelation = $catalogProductRelation; - parent::__construct($resource, $objectRelationProcessor); + parent::__construct($resource, $transactionManager); } /** diff --git a/app/code/Magento/Catalog/Model/Resource/Product/Option.php b/app/code/Magento/Catalog/Model/Resource/Product/Option.php index f3cbb1c7acd9f..fcdca6da8a079 100644 --- a/app/code/Magento/Catalog/Model/Resource/Product/Option.php +++ b/app/code/Magento/Catalog/Model/Resource/Product/Option.php @@ -37,14 +37,14 @@ class Option extends \Magento\Framework\Model\Resource\Db\AbstractDb * Class constructor * * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param \Magento\Directory\Model\CurrencyFactory $currencyFactory * @param \Magento\Framework\Store\StoreManagerInterface $storeManager * @param \Magento\Framework\App\Config\ScopeConfigInterface $config */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, \Magento\Directory\Model\CurrencyFactory $currencyFactory, \Magento\Framework\Store\StoreManagerInterface $storeManager, \Magento\Framework\App\Config\ScopeConfigInterface $config @@ -52,7 +52,7 @@ public function __construct( $this->_currencyFactory = $currencyFactory; $this->_storeManager = $storeManager; $this->_config = $config; - parent::__construct($resource, $objectRelationProcessor); + parent::__construct($resource, $transactionManager); } /** diff --git a/app/code/Magento/Catalog/Model/Resource/Product/Option/Value.php b/app/code/Magento/Catalog/Model/Resource/Product/Option/Value.php index c79fac807026a..6586e5d045922 100644 --- a/app/code/Magento/Catalog/Model/Resource/Product/Option/Value.php +++ b/app/code/Magento/Catalog/Model/Resource/Product/Option/Value.php @@ -37,14 +37,14 @@ class Value extends \Magento\Framework\Model\Resource\Db\AbstractDb * Class constructor * * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param \Magento\Directory\Model\CurrencyFactory $currencyFactory * @param \Magento\Framework\Store\StoreManagerInterface $storeManager * @param \Magento\Framework\App\Config\ScopeConfigInterface $config */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, \Magento\Directory\Model\CurrencyFactory $currencyFactory, \Magento\Framework\Store\StoreManagerInterface $storeManager, \Magento\Framework\App\Config\ScopeConfigInterface $config @@ -52,7 +52,7 @@ public function __construct( $this->_currencyFactory = $currencyFactory; $this->_storeManager = $storeManager; $this->_config = $config; - parent::__construct($resource, $objectRelationProcessor); + parent::__construct($resource, $transactionManager); } /** diff --git a/app/code/Magento/Catalog/Model/Resource/Product/Website.php b/app/code/Magento/Catalog/Model/Resource/Product/Website.php index 6bd4c53ee2c82..773c2802d3c5c 100644 --- a/app/code/Magento/Catalog/Model/Resource/Product/Website.php +++ b/app/code/Magento/Catalog/Model/Resource/Product/Website.php @@ -19,16 +19,16 @@ class Website extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param \Magento\Framework\Store\StoreManagerInterface $storeManager */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, \Magento\Framework\Store\StoreManagerInterface $storeManager ) { $this->_storeManager = $storeManager; - parent::__construct($resource, $objectRelationProcessor); + parent::__construct($resource, $transactionManager); } /** diff --git a/app/code/Magento/Catalog/Model/Resource/Url.php b/app/code/Magento/Catalog/Model/Resource/Url.php index b5525addb27dd..d82c91066c940 100644 --- a/app/code/Magento/Catalog/Model/Resource/Url.php +++ b/app/code/Magento/Catalog/Model/Resource/Url.php @@ -89,7 +89,7 @@ class Url extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param \Magento\Framework\Store\StoreManagerInterface $storeManager * @param \Magento\Eav\Model\Config $eavConfig * @param Product $productResource @@ -98,7 +98,7 @@ class Url extends \Magento\Framework\Model\Resource\Db\AbstractDb */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, \Magento\Framework\Store\StoreManagerInterface $storeManager, \Magento\Eav\Model\Config $eavConfig, Product $productResource, @@ -110,7 +110,7 @@ public function __construct( $this->productResource = $productResource; $this->_catalogCategory = $catalogCategory; $this->_logger = $logger; - parent::__construct($resource, $objectRelationProcessor); + parent::__construct($resource, $transactionManager); } /** diff --git a/app/code/Magento/CatalogInventory/Model/Resource/Indexer/Stock/DefaultStock.php b/app/code/Magento/CatalogInventory/Model/Resource/Indexer/Stock/DefaultStock.php index 7c82377575e70..97f9788d5bb78 100644 --- a/app/code/Magento/CatalogInventory/Model/Resource/Indexer/Stock/DefaultStock.php +++ b/app/code/Magento/CatalogInventory/Model/Resource/Indexer/Stock/DefaultStock.php @@ -36,18 +36,18 @@ class DefaultStock extends \Magento\Catalog\Model\Resource\Product\Indexer\Abstr * Class constructor * * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, \Magento\Eav\Model\Config $eavConfig, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig ) { $this->_scopeConfig = $scopeConfig; - parent::__construct($resource, $objectRelationProcessor, $eavConfig); + parent::__construct($resource, $transactionManager, $eavConfig); } /** diff --git a/app/code/Magento/CatalogInventory/Model/Resource/Stock.php b/app/code/Magento/CatalogInventory/Model/Resource/Stock.php index a1388f4c4b3d2..35430da4523c1 100644 --- a/app/code/Magento/CatalogInventory/Model/Resource/Stock.php +++ b/app/code/Magento/CatalogInventory/Model/Resource/Stock.php @@ -80,7 +80,7 @@ class Stock extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Framework\Stdlib\DateTime $dateTime * @param StockConfigurationInterface $stockConfiguration @@ -88,13 +88,13 @@ class Stock extends \Magento\Framework\Model\Resource\Db\AbstractDb */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Framework\Stdlib\DateTime $dateTime, StockConfigurationInterface $stockConfiguration, StoreManagerInterface $storeManager ) { - parent::__construct($resource, $objectRelationProcessor); + parent::__construct($resource, $transactionManager); $this->_scopeConfig = $scopeConfig; $this->dateTime = $dateTime; $this->stockConfiguration = $stockConfiguration; diff --git a/app/code/Magento/CatalogInventory/Model/Resource/Stock/Item.php b/app/code/Magento/CatalogInventory/Model/Resource/Stock/Item.php index cdb7be49e3676..1c9888e1a7342 100644 --- a/app/code/Magento/CatalogInventory/Model/Resource/Stock/Item.php +++ b/app/code/Magento/CatalogInventory/Model/Resource/Stock/Item.php @@ -9,7 +9,7 @@ use Magento\CatalogInventory\Model\Indexer\Stock\Processor; use Magento\Framework\App\Resource as AppResource; use Magento\Framework\Model\AbstractModel; -use Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface; +use Magento\Framework\Model\Resource\Db\TransactionManagerInterface; /** * Stock item resource model @@ -30,16 +30,16 @@ class Item extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param AppResource $resource - * @param ObjectRelationProcessorInterface $objectRelationProcessor + * @param TransactionManagerInterface $transactionManager * @param Processor $processor */ public function __construct( AppResource $resource, - ObjectRelationProcessorInterface $objectRelationProcessor, + TransactionManagerInterface $transactionManager, Processor $processor ) { $this->stockIndexerProcessor = $processor; - parent::__construct($resource, $objectRelationProcessor); + parent::__construct($resource, $transactionManager); } /** diff --git a/app/code/Magento/CatalogInventory/Model/Resource/Stock/Status.php b/app/code/Magento/CatalogInventory/Model/Resource/Stock/Status.php index d68b6adc6dd21..a4c130c891e99 100644 --- a/app/code/Magento/CatalogInventory/Model/Resource/Stock/Status.php +++ b/app/code/Magento/CatalogInventory/Model/Resource/Stock/Status.php @@ -33,19 +33,19 @@ class Status extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param \Magento\Framework\Store\StoreManagerInterface $storeManager * @param \Magento\Store\Model\WebsiteFactory $websiteFactory * @param \Magento\Eav\Model\Config $eavConfig */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, \Magento\Framework\Store\StoreManagerInterface $storeManager, \Magento\Store\Model\WebsiteFactory $websiteFactory, \Magento\Eav\Model\Config $eavConfig ) { - parent::__construct($resource, $objectRelationProcessor); + parent::__construct($resource, $transactionManager); $this->_storeManager = $storeManager; $this->_websiteFactory = $websiteFactory; diff --git a/app/code/Magento/CatalogRule/Model/Resource/Rule.php b/app/code/Magento/CatalogRule/Model/Resource/Rule.php index 0db9a5e10b400..b0ffac45b0733 100644 --- a/app/code/Magento/CatalogRule/Model/Resource/Rule.php +++ b/app/code/Magento/CatalogRule/Model/Resource/Rule.php @@ -94,7 +94,7 @@ class Rule extends \Magento\Rule\Model\Resource\AbstractResource /** * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param \Magento\Framework\Store\StoreManagerInterface $storeManager * @param Product\ConditionFactory $conditionFactory * @param \Magento\Framework\Stdlib\DateTime\DateTime $coreDate @@ -108,7 +108,7 @@ class Rule extends \Magento\Rule\Model\Resource\AbstractResource */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, \Magento\Framework\Store\StoreManagerInterface $storeManager, \Magento\Catalog\Model\Product\ConditionFactory $conditionFactory, \Magento\Framework\Stdlib\DateTime\DateTime $coreDate, @@ -128,7 +128,7 @@ public function __construct( $this->_logger = $logger; $this->dateTime = $dateTime; $this->priceCurrency = $priceCurrency; - parent::__construct($resource, $objectRelationProcessor); + parent::__construct($resource, $transactionManager); } /** diff --git a/app/code/Magento/CatalogSearch/Model/Resource/Advanced.php b/app/code/Magento/CatalogSearch/Model/Resource/Advanced.php index d8c383eeb9c6f..7d81a5d787fd2 100644 --- a/app/code/Magento/CatalogSearch/Model/Resource/Advanced.php +++ b/app/code/Magento/CatalogSearch/Model/Resource/Advanced.php @@ -30,19 +30,19 @@ class Advanced extends \Magento\Framework\Model\Resource\Db\AbstractDb * Construct * * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param \Magento\Framework\Store\StoreManagerInterface $storeManager * @param \Magento\Framework\Event\ManagerInterface $eventManager */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, \Magento\Framework\Store\StoreManagerInterface $storeManager, \Magento\Framework\Event\ManagerInterface $eventManager ) { $this->_storeManager = $storeManager; $this->_eventManager = $eventManager; - parent::__construct($resource, $objectRelationProcessor); + parent::__construct($resource, $transactionManager); } /** diff --git a/app/code/Magento/CatalogSearch/Model/Resource/Engine.php b/app/code/Magento/CatalogSearch/Model/Resource/Engine.php index 4601aad805e87..a021c1e2a475a 100644 --- a/app/code/Magento/CatalogSearch/Model/Resource/Engine.php +++ b/app/code/Magento/CatalogSearch/Model/Resource/Engine.php @@ -48,7 +48,7 @@ class Engine extends AbstractDb implements EngineInterface * Construct * * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param \Magento\Catalog\Model\Product\Visibility $catalogProductVisibility * @param Advanced $searchResource * @param \Magento\CatalogSearch\Helper\Data $catalogSearchData @@ -56,7 +56,7 @@ class Engine extends AbstractDb implements EngineInterface */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, \Magento\Catalog\Model\Product\Visibility $catalogProductVisibility, \Magento\CatalogSearch\Model\Resource\Advanced $searchResource, \Magento\CatalogSearch\Helper\Data $catalogSearchData, @@ -66,7 +66,7 @@ public function __construct( $this->_searchResource = $searchResource; $this->_catalogSearchData = $catalogSearchData; $this->_resourceHelper = $resourceHelper; - parent::__construct($resource, $objectRelationProcessor); + parent::__construct($resource, $transactionManager); } /** diff --git a/app/code/Magento/CatalogSearch/Model/Resource/Fulltext.php b/app/code/Magento/CatalogSearch/Model/Resource/Fulltext.php index 026fd76e8ea4f..eae9f2cfb965d 100644 --- a/app/code/Magento/CatalogSearch/Model/Resource/Fulltext.php +++ b/app/code/Magento/CatalogSearch/Model/Resource/Fulltext.php @@ -35,14 +35,14 @@ class Fulltext extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Framework\Filter\FilterManager $filter * @param Helper $resourceHelper */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Framework\Filter\FilterManager $filter, \Magento\Search\Model\Resource\Helper $resourceHelper @@ -50,7 +50,7 @@ public function __construct( $this->_eventManager = $eventManager; $this->filter = $filter; $this->_resourceHelper = $resourceHelper; - parent::__construct($resource, $objectRelationProcessor); + parent::__construct($resource, $transactionManager); } /** diff --git a/app/code/Magento/CheckoutAgreements/Model/Resource/Agreement.php b/app/code/Magento/CheckoutAgreements/Model/Resource/Agreement.php index 32a36645d5bd8..465fd64e0879d 100644 --- a/app/code/Magento/CheckoutAgreements/Model/Resource/Agreement.php +++ b/app/code/Magento/CheckoutAgreements/Model/Resource/Agreement.php @@ -20,16 +20,16 @@ class Agreement extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param \Magento\Framework\Filter\FilterManager $filterManager */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, \Magento\Framework\Filter\FilterManager $filterManager ) { $this->filterManager = $filterManager; - parent::__construct($resource, $objectRelationProcessor); + parent::__construct($resource, $transactionManager); } /** diff --git a/app/code/Magento/Cms/Model/Resource/Block.php b/app/code/Magento/Cms/Model/Resource/Block.php index ca71333ef91d8..6de1556cdb0cd 100644 --- a/app/code/Magento/Cms/Model/Resource/Block.php +++ b/app/code/Magento/Cms/Model/Resource/Block.php @@ -26,17 +26,17 @@ class Block extends \Magento\Framework\Model\Resource\Db\AbstractDb * Construct * * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param \Magento\Framework\Stdlib\DateTime\DateTime $date * @param \Magento\Framework\Store\StoreManagerInterface $storeManager */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, \Magento\Framework\Stdlib\DateTime\DateTime $date, \Magento\Framework\Store\StoreManagerInterface $storeManager ) { - parent::__construct($resource, $objectRelationProcessor); + parent::__construct($resource, $transactionManager); $this->_storeManager = $storeManager; $this->_date = $date; } diff --git a/app/code/Magento/Cms/Model/Resource/Page.php b/app/code/Magento/Cms/Model/Resource/Page.php index 08e4b1fcbe3ed..1fecc2a304ffe 100644 --- a/app/code/Magento/Cms/Model/Resource/Page.php +++ b/app/code/Magento/Cms/Model/Resource/Page.php @@ -41,19 +41,19 @@ class Page extends \Magento\Framework\Model\Resource\Db\AbstractDb * Construct * * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param \Magento\Framework\Stdlib\DateTime\DateTime $date * @param \Magento\Framework\Store\StoreManagerInterface $storeManager * @param \Magento\Framework\Stdlib\DateTime $dateTime */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, \Magento\Framework\Stdlib\DateTime\DateTime $date, \Magento\Framework\Store\StoreManagerInterface $storeManager, \Magento\Framework\Stdlib\DateTime $dateTime ) { - parent::__construct($resource, $objectRelationProcessor); + parent::__construct($resource, $transactionManager); $this->_date = $date; $this->_storeManager = $storeManager; $this->dateTime = $dateTime; diff --git a/app/code/Magento/ConfigurableProduct/Model/Resource/Product/Type/Configurable.php b/app/code/Magento/ConfigurableProduct/Model/Resource/Product/Type/Configurable.php index 068a02425db49..c4c1ae1507343 100644 --- a/app/code/Magento/ConfigurableProduct/Model/Resource/Product/Type/Configurable.php +++ b/app/code/Magento/ConfigurableProduct/Model/Resource/Product/Type/Configurable.php @@ -18,16 +18,16 @@ class Configurable extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param \Magento\Catalog\Model\Resource\Product\Relation $catalogProductRelation */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, \Magento\Catalog\Model\Resource\Product\Relation $catalogProductRelation ) { $this->_catalogProductRelation = $catalogProductRelation; - parent::__construct($resource, $objectRelationProcessor); + parent::__construct($resource, $transactionManager); } /** diff --git a/app/code/Magento/ConfigurableProduct/Model/Resource/Product/Type/Configurable/Attribute.php b/app/code/Magento/ConfigurableProduct/Model/Resource/Product/Type/Configurable/Attribute.php index 5382a16fa4057..d8b1977671239 100644 --- a/app/code/Magento/ConfigurableProduct/Model/Resource/Product/Type/Configurable/Attribute.php +++ b/app/code/Magento/ConfigurableProduct/Model/Resource/Product/Type/Configurable/Attribute.php @@ -41,19 +41,19 @@ class Attribute extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param \Magento\Framework\Store\StoreManagerInterface $storeManager * @param \Magento\Catalog\Helper\Data $catalogData */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, \Magento\Framework\Store\StoreManagerInterface $storeManager, \Magento\Catalog\Helper\Data $catalogData ) { $this->_storeManager = $storeManager; $this->_catalogData = $catalogData; - parent::__construct($resource, $objectRelationProcessor); + parent::__construct($resource, $transactionManager); } /** diff --git a/app/code/Magento/Core/Model/Resource/File/Storage/Database.php b/app/code/Magento/Core/Model/Resource/File/Storage/Database.php index 90c0aa8642405..d9a274a81e75d 100644 --- a/app/code/Magento/Core/Model/Resource/File/Storage/Database.php +++ b/app/code/Magento/Core/Model/Resource/File/Storage/Database.php @@ -17,15 +17,15 @@ class Database extends \Magento\Core\Model\Resource\File\Storage\AbstractStorage /** * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param \Magento\Framework\DB\Helper $resourceHelper */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, \Magento\Framework\DB\Helper $resourceHelper ) { - parent::__construct($resource, $objectRelationProcessor); + parent::__construct($resource, $transactionManager); $this->_resourceHelper = $resourceHelper; } diff --git a/app/code/Magento/Core/Model/Resource/Layout/Update.php b/app/code/Magento/Core/Model/Resource/Layout/Update.php index 2ab68502df1d2..aee0062ad6eb6 100644 --- a/app/code/Magento/Core/Model/Resource/Layout/Update.php +++ b/app/code/Magento/Core/Model/Resource/Layout/Update.php @@ -20,15 +20,15 @@ class Update extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param \Magento\Framework\Cache\FrontendInterface $cache */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, \Magento\Framework\Cache\FrontendInterface $cache ) { - parent::__construct($resource, $objectRelationProcessor); + parent::__construct($resource, $transactionManager); $this->_cache = $cache; } diff --git a/app/code/Magento/Customer/Model/Resource/Group.php b/app/code/Magento/Customer/Model/Resource/Group.php index a6a293fa0c027..82c1889dcdc05 100644 --- a/app/code/Magento/Customer/Model/Resource/Group.php +++ b/app/code/Magento/Customer/Model/Resource/Group.php @@ -26,19 +26,19 @@ class Group extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param \Magento\Customer\Api\GroupManagementInterface $groupManagement * @param Customer\CollectionFactory $customersFactory */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, \Magento\Customer\Api\GroupManagementInterface $groupManagement, \Magento\Customer\Model\Resource\Customer\CollectionFactory $customersFactory ) { $this->_groupManagement = $groupManagement; $this->_customersFactory = $customersFactory; - parent::__construct($resource, $objectRelationProcessor); + parent::__construct($resource, $transactionManager); } /** diff --git a/app/code/Magento/Customer/Model/Resource/Visitor.php b/app/code/Magento/Customer/Model/Resource/Visitor.php index 51c806ce8d1d5..3f296818071f9 100644 --- a/app/code/Magento/Customer/Model/Resource/Visitor.php +++ b/app/code/Magento/Customer/Model/Resource/Visitor.php @@ -24,19 +24,19 @@ class Visitor extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param \Magento\Framework\Stdlib\DateTime\DateTime $date * @param \Magento\Framework\Stdlib\DateTime $dateTime */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, \Magento\Framework\Stdlib\DateTime\DateTime $date, \Magento\Framework\Stdlib\DateTime $dateTime ) { $this->date = $date; $this->dateTime = $dateTime; - parent::__construct($resource, $objectRelationProcessor); + parent::__construct($resource, $transactionManager); } /** diff --git a/app/code/Magento/CustomerImportExport/Model/Resource/Import/CustomerComposite/Data.php b/app/code/Magento/CustomerImportExport/Model/Resource/Import/CustomerComposite/Data.php index 6ea78c8123dc0..91ffac5f60098 100644 --- a/app/code/Magento/CustomerImportExport/Model/Resource/Import/CustomerComposite/Data.php +++ b/app/code/Magento/CustomerImportExport/Model/Resource/Import/CustomerComposite/Data.php @@ -27,17 +27,17 @@ class Data extends \Magento\ImportExport\Model\Resource\Import\Data * Class constructor * * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param \Magento\Core\Helper\Data $coreHelper * @param array $arguments */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, \Magento\Core\Helper\Data $coreHelper, array $arguments = [] ) { - parent::__construct($resource, $objectRelationProcessor, $coreHelper, $arguments); + parent::__construct($resource, $transactionManager, $coreHelper, $arguments); if (isset($arguments['entity_type'])) { $this->_entityType = $arguments['entity_type']; diff --git a/app/code/Magento/DesignEditor/Model/Theme/Resource/Change.php b/app/code/Magento/DesignEditor/Model/Theme/Resource/Change.php index 2b670ae1a8ea5..e2b36ee26f1f9 100644 --- a/app/code/Magento/DesignEditor/Model/Theme/Resource/Change.php +++ b/app/code/Magento/DesignEditor/Model/Theme/Resource/Change.php @@ -17,17 +17,17 @@ class Change extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param \Magento\Framework\Stdlib\DateTime $dateTime * @return void */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, \Magento\Framework\Stdlib\DateTime $dateTime ) { $this->dateTime = $dateTime; - parent::__construct($resource, $objectRelationProcessor); + parent::__construct($resource, $transactionManager); } /** diff --git a/app/code/Magento/Directory/Model/Resource/Region.php b/app/code/Magento/Directory/Model/Resource/Region.php index 58ec9a18e0b6d..1e2cc1a38065e 100644 --- a/app/code/Magento/Directory/Model/Resource/Region.php +++ b/app/code/Magento/Directory/Model/Resource/Region.php @@ -27,15 +27,15 @@ class Region extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param \Magento\Framework\Locale\ResolverInterface $localeResolver */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, \Magento\Framework\Locale\ResolverInterface $localeResolver ) { - parent::__construct($resource, $objectRelationProcessor); + parent::__construct($resource, $transactionManager); $this->_localeResolver = $localeResolver; } diff --git a/app/code/Magento/Downloadable/Model/Resource/Link.php b/app/code/Magento/Downloadable/Model/Resource/Link.php index 8ee288054628d..b10a06988bf0e 100644 --- a/app/code/Magento/Downloadable/Model/Resource/Link.php +++ b/app/code/Magento/Downloadable/Model/Resource/Link.php @@ -36,7 +36,7 @@ class Link extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Framework\App\Config\ScopeConfigInterface $configuration * @param \Magento\Directory\Model\CurrencyFactory $currencyFactory @@ -44,7 +44,7 @@ class Link extends \Magento\Framework\Model\Resource\Db\AbstractDb */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, \Magento\Catalog\Helper\Data $catalogData, \Magento\Framework\App\Config\ScopeConfigInterface $configuration, \Magento\Directory\Model\CurrencyFactory $currencyFactory, @@ -54,7 +54,7 @@ public function __construct( $this->_configuration = $configuration; $this->_currencyFactory = $currencyFactory; $this->_storeManager = $storeManager; - parent::__construct($resource, $objectRelationProcessor); + parent::__construct($resource, $transactionManager); } /** diff --git a/app/code/Magento/Eav/Model/Resource/Entity/Attribute.php b/app/code/Magento/Eav/Model/Resource/Entity/Attribute.php index 1d1ec5b115f53..31c60d0385ff5 100644 --- a/app/code/Magento/Eav/Model/Resource/Entity/Attribute.php +++ b/app/code/Magento/Eav/Model/Resource/Entity/Attribute.php @@ -38,19 +38,19 @@ class Attribute extends \Magento\Framework\Model\Resource\Db\AbstractDb * Class constructor * * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param \Magento\Framework\Store\StoreManagerInterface $storeManager * @param Type $eavEntityType */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, \Magento\Framework\Store\StoreManagerInterface $storeManager, Type $eavEntityType ) { $this->_storeManager = $storeManager; $this->_eavEntityType = $eavEntityType; - parent::__construct($resource, $objectRelationProcessor); + parent::__construct($resource, $transactionManager); } /** diff --git a/app/code/Magento/Eav/Model/Resource/Entity/Attribute/Set.php b/app/code/Magento/Eav/Model/Resource/Entity/Attribute/Set.php index 5d0fb84f5055b..01840fcc69c7f 100644 --- a/app/code/Magento/Eav/Model/Resource/Entity/Attribute/Set.php +++ b/app/code/Magento/Eav/Model/Resource/Entity/Attribute/Set.php @@ -24,17 +24,17 @@ class Set extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param GroupFactory $attrGroupFactory * @param \Magento\Eav\Model\Config $eavConfig */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, \Magento\Eav\Model\Resource\Entity\Attribute\GroupFactory $attrGroupFactory, \Magento\Eav\Model\Config $eavConfig ) { - parent::__construct($resource, $objectRelationProcessor); + parent::__construct($resource, $transactionManager); $this->_attrGroupFactory = $attrGroupFactory; $this->eavConfig = $eavConfig; } diff --git a/app/code/Magento/Email/Model/Resource/Template.php b/app/code/Magento/Email/Model/Resource/Template.php index b7cafcca61e99..6d779eb6b3cf8 100644 --- a/app/code/Magento/Email/Model/Resource/Template.php +++ b/app/code/Magento/Email/Model/Resource/Template.php @@ -21,16 +21,16 @@ class Template extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param \Magento\Framework\Stdlib\DateTime $dateTime */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, \Magento\Framework\Stdlib\DateTime $dateTime ) { $this->dateTime = $dateTime; - parent::__construct($resource, $objectRelationProcessor); + parent::__construct($resource, $transactionManager); } /** diff --git a/app/code/Magento/ImportExport/Model/Resource/Import/Data.php b/app/code/Magento/ImportExport/Model/Resource/Import/Data.php index a98792121715b..9fd2254b28c2a 100644 --- a/app/code/Magento/ImportExport/Model/Resource/Import/Data.php +++ b/app/code/Magento/ImportExport/Model/Resource/Import/Data.php @@ -28,17 +28,17 @@ class Data extends \Magento\Framework\Model\Resource\Db\AbstractDb implements \I * Class constructor * * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param \Magento\Core\Helper\Data $coreHelper * @param array $arguments */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, \Magento\Core\Helper\Data $coreHelper, array $arguments = [] ) { - parent::__construct($resource, $objectRelationProcessor); + parent::__construct($resource, $transactionManager); $this->_jsonHelper = $coreHelper; } diff --git a/app/code/Magento/Integration/Model/Resource/Oauth/Consumer.php b/app/code/Magento/Integration/Model/Resource/Oauth/Consumer.php index 7c39726a40dcf..959b57c5afadc 100644 --- a/app/code/Magento/Integration/Model/Resource/Oauth/Consumer.php +++ b/app/code/Magento/Integration/Model/Resource/Oauth/Consumer.php @@ -14,16 +14,16 @@ class Consumer extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param \Magento\Framework\Stdlib\DateTime $dateTime */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, \Magento\Framework\Stdlib\DateTime $dateTime ) { $this->_dateTime = $dateTime; - parent::__construct($resource, $objectRelationProcessor); + parent::__construct($resource, $transactionManager); } /** diff --git a/app/code/Magento/Integration/Model/Resource/Oauth/Token.php b/app/code/Magento/Integration/Model/Resource/Oauth/Token.php index b47c97336c7a1..9274429f76f75 100644 --- a/app/code/Magento/Integration/Model/Resource/Oauth/Token.php +++ b/app/code/Magento/Integration/Model/Resource/Oauth/Token.php @@ -19,16 +19,16 @@ class Token extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param \Magento\Framework\Stdlib\DateTime $dateTime */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, \Magento\Framework\Stdlib\DateTime $dateTime ) { $this->_dateTime = $dateTime; - parent::__construct($resource, $objectRelationProcessor); + parent::__construct($resource, $transactionManager); } /** diff --git a/app/code/Magento/Log/Model/Resource/Log.php b/app/code/Magento/Log/Model/Resource/Log.php index 88ed3ebbf724c..ca14630693250 100644 --- a/app/code/Magento/Log/Model/Resource/Log.php +++ b/app/code/Magento/Log/Model/Resource/Log.php @@ -31,14 +31,14 @@ class Log extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param \Magento\Framework\Stdlib\DateTime\DateTime $date * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Framework\Stdlib\DateTime $dateTime */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, \Magento\Framework\Stdlib\DateTime\DateTime $date, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Framework\Stdlib\DateTime $dateTime @@ -46,7 +46,7 @@ public function __construct( $this->_date = $date; $this->_eventManager = $eventManager; $this->dateTime = $dateTime; - parent::__construct($resource, $objectRelationProcessor); + parent::__construct($resource, $transactionManager); } /** diff --git a/app/code/Magento/Log/Model/Resource/Visitor.php b/app/code/Magento/Log/Model/Resource/Visitor.php index 2a852a21c4c27..313e884a9ea7a 100644 --- a/app/code/Magento/Log/Model/Resource/Visitor.php +++ b/app/code/Magento/Log/Model/Resource/Visitor.php @@ -36,14 +36,14 @@ class Visitor extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param \Magento\Framework\Stdlib\DateTime\DateTime $date * @param \Magento\Framework\Store\StoreManagerInterface $storeManager * @param \Magento\Framework\Stdlib\String $string */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, \Magento\Framework\Stdlib\DateTime\DateTime $date, \Magento\Framework\Store\StoreManagerInterface $storeManager, \Magento\Framework\Stdlib\String $string @@ -51,7 +51,7 @@ public function __construct( $this->_date = $date; $this->_storeManager = $storeManager; $this->string = $string; - parent::__construct($resource, $objectRelationProcessor); + parent::__construct($resource, $transactionManager); } /** diff --git a/app/code/Magento/Log/Model/Resource/Visitor/Online.php b/app/code/Magento/Log/Model/Resource/Visitor/Online.php index 00370e5d32a95..e319420e7df28 100644 --- a/app/code/Magento/Log/Model/Resource/Visitor/Online.php +++ b/app/code/Magento/Log/Model/Resource/Visitor/Online.php @@ -22,16 +22,16 @@ class Online extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param \Magento\Framework\Stdlib\DateTime\DateTime $date */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, \Magento\Framework\Stdlib\DateTime\DateTime $date ) { $this->_date = $date; - parent::__construct($resource, $objectRelationProcessor); + parent::__construct($resource, $transactionManager); } /** diff --git a/app/code/Magento/Newsletter/Model/Resource/Queue.php b/app/code/Magento/Newsletter/Model/Resource/Queue.php index 142b365411d8a..7c82262ad8e50 100644 --- a/app/code/Magento/Newsletter/Model/Resource/Queue.php +++ b/app/code/Magento/Newsletter/Model/Resource/Queue.php @@ -26,15 +26,15 @@ class Queue extends \Magento\Framework\Model\Resource\Db\AbstractDb * Construct * * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param \Magento\Newsletter\Model\Resource\Subscriber\Collection $subscriberCollection */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, \Magento\Newsletter\Model\Resource\Subscriber\Collection $subscriberCollection ) { - parent::__construct($resource, $objectRelationProcessor); + parent::__construct($resource, $transactionManager); $this->_subscriberCollection = $subscriberCollection; } diff --git a/app/code/Magento/Newsletter/Model/Resource/Subscriber.php b/app/code/Magento/Newsletter/Model/Resource/Subscriber.php index 96d23c97e5957..b79058bf2261f 100644 --- a/app/code/Magento/Newsletter/Model/Resource/Subscriber.php +++ b/app/code/Magento/Newsletter/Model/Resource/Subscriber.php @@ -56,19 +56,19 @@ class Subscriber extends \Magento\Framework\Model\Resource\Db\AbstractDb * Construct * * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param \Magento\Framework\Stdlib\DateTime\DateTime $date * @param \Magento\Framework\Math\Random $mathRandom */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, \Magento\Framework\Stdlib\DateTime\DateTime $date, \Magento\Framework\Math\Random $mathRandom ) { $this->_date = $date; $this->mathRandom = $mathRandom; - parent::__construct($resource, $objectRelationProcessor); + parent::__construct($resource, $transactionManager); } /** diff --git a/app/code/Magento/Newsletter/Model/Resource/Template.php b/app/code/Magento/Newsletter/Model/Resource/Template.php index cef257d11d9fa..a831e95d7829a 100644 --- a/app/code/Magento/Newsletter/Model/Resource/Template.php +++ b/app/code/Magento/Newsletter/Model/Resource/Template.php @@ -24,15 +24,15 @@ class Template extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param \Magento\Framework\Stdlib\DateTime\DateTime $date */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, \Magento\Framework\Stdlib\DateTime\DateTime $date ) { - parent::__construct($resource, $objectRelationProcessor); + parent::__construct($resource, $transactionManager); $this->_date = $date; } diff --git a/app/code/Magento/OfflineShipping/Model/Resource/Carrier/Tablerate.php b/app/code/Magento/OfflineShipping/Model/Resource/Carrier/Tablerate.php index ebc87479fd1dc..60d12b7245b94 100644 --- a/app/code/Magento/OfflineShipping/Model/Resource/Carrier/Tablerate.php +++ b/app/code/Magento/OfflineShipping/Model/Resource/Carrier/Tablerate.php @@ -123,7 +123,7 @@ class Tablerate extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\App\Config\ScopeConfigInterface $coreConfig * @param \Magento\Framework\Store\StoreManagerInterface $storeManager @@ -134,7 +134,7 @@ class Tablerate extends \Magento\Framework\Model\Resource\Db\AbstractDb */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, \Psr\Log\LoggerInterface $logger, \Magento\Framework\App\Config\ScopeConfigInterface $coreConfig, \Magento\Framework\Store\StoreManagerInterface $storeManager, @@ -143,7 +143,7 @@ public function __construct( \Magento\Directory\Model\Resource\Region\CollectionFactory $regionCollectionFactory, \Magento\Framework\Filesystem $filesystem ) { - parent::__construct($resource, $objectRelationProcessor); + parent::__construct($resource, $transactionManager); $this->_coreConfig = $coreConfig; $this->_logger = $logger; $this->_storeManager = $storeManager; diff --git a/app/code/Magento/Persistent/Model/Resource/Session.php b/app/code/Magento/Persistent/Model/Resource/Session.php index 3e3726526f28d..68c9f1e873f34 100644 --- a/app/code/Magento/Persistent/Model/Resource/Session.php +++ b/app/code/Magento/Persistent/Model/Resource/Session.php @@ -28,16 +28,16 @@ class Session extends \Magento\Framework\Model\Resource\Db\AbstractDb * Class constructor * * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param \Magento\Persistent\Model\SessionFactory $sessionFactory */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, \Magento\Persistent\Model\SessionFactory $sessionFactory ) { $this->_sessionFactory = $sessionFactory; - parent::__construct($resource, $objectRelationProcessor); + parent::__construct($resource, $transactionManager); } /** diff --git a/app/code/Magento/ProductAlert/Model/Resource/Price.php b/app/code/Magento/ProductAlert/Model/Resource/Price.php index 6086f997835d5..818ac0b9189b7 100644 --- a/app/code/Magento/ProductAlert/Model/Resource/Price.php +++ b/app/code/Magento/ProductAlert/Model/Resource/Price.php @@ -20,16 +20,16 @@ class Price extends \Magento\ProductAlert\Model\Resource\AbstractResource /** * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param \Magento\Framework\Stdlib\DateTime\DateTimeFactory $dateFactory */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, \Magento\Framework\Stdlib\DateTime\DateTimeFactory $dateFactory ) { $this->_dateFactory = $dateFactory; - parent::__construct($resource, $objectRelationProcessor); + parent::__construct($resource, $transactionManager); } /** diff --git a/app/code/Magento/ProductAlert/Model/Resource/Stock.php b/app/code/Magento/ProductAlert/Model/Resource/Stock.php index 8984dbaf9649f..11f09b6f5ca99 100644 --- a/app/code/Magento/ProductAlert/Model/Resource/Stock.php +++ b/app/code/Magento/ProductAlert/Model/Resource/Stock.php @@ -20,16 +20,16 @@ class Stock extends \Magento\ProductAlert\Model\Resource\AbstractResource /** * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param \Magento\Framework\Stdlib\DateTime\DateTimeFactory $dateFactory */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, \Magento\Framework\Stdlib\DateTime\DateTimeFactory $dateFactory ) { $this->_dateFactory = $dateFactory; - parent::__construct($resource, $objectRelationProcessor); + parent::__construct($resource, $transactionManager); } /** diff --git a/app/code/Magento/Quote/Model/Resource/Quote.php b/app/code/Magento/Quote/Model/Resource/Quote.php index 9058335ca89f2..7d9b502c5e753 100644 --- a/app/code/Magento/Quote/Model/Resource/Quote.php +++ b/app/code/Magento/Quote/Model/Resource/Quote.php @@ -22,15 +22,15 @@ class Quote extends AbstractDb /** * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param \Magento\Eav\Model\Config $config */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, \Magento\Eav\Model\Config $config ) { - parent::__construct($resource, $objectRelationProcessor); + parent::__construct($resource, $transactionManager); $this->_config = $config; } diff --git a/app/code/Magento/Reports/Model/Resource/Event.php b/app/code/Magento/Reports/Model/Resource/Event.php index 79889549feb41..2698dd488708d 100644 --- a/app/code/Magento/Reports/Model/Resource/Event.php +++ b/app/code/Magento/Reports/Model/Resource/Event.php @@ -24,17 +24,17 @@ class Event extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Framework\Store\StoreManagerInterface $storeManager */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Framework\Store\StoreManagerInterface $storeManager ) { - parent::__construct($resource, $objectRelationProcessor); + parent::__construct($resource, $transactionManager); $this->_scopeConfig = $scopeConfig; $this->_storeManager = $storeManager; } diff --git a/app/code/Magento/Reports/Model/Resource/Product/Index/AbstractIndex.php b/app/code/Magento/Reports/Model/Resource/Product/Index/AbstractIndex.php index 36b2717a21f05..36b8d13097ee9 100644 --- a/app/code/Magento/Reports/Model/Resource/Product/Index/AbstractIndex.php +++ b/app/code/Magento/Reports/Model/Resource/Product/Index/AbstractIndex.php @@ -25,17 +25,17 @@ abstract class AbstractIndex extends \Magento\Framework\Model\Resource\Db\Abstra /** * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param \Magento\Reports\Model\Resource\Helper $resourceHelper * @param \Magento\Framework\Stdlib\DateTime $dateTime */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, \Magento\Reports\Model\Resource\Helper $resourceHelper, \Magento\Framework\Stdlib\DateTime $dateTime ) { - parent::__construct($resource, $objectRelationProcessor); + parent::__construct($resource, $transactionManager); $this->_resourceHelper = $resourceHelper; $this->dateTime = $dateTime; } diff --git a/app/code/Magento/Reports/Model/Resource/Report/AbstractReport.php b/app/code/Magento/Reports/Model/Resource/Report/AbstractReport.php index 0c1f394b0ad26..7d1ba3291e3c2 100644 --- a/app/code/Magento/Reports/Model/Resource/Report/AbstractReport.php +++ b/app/code/Magento/Reports/Model/Resource/Report/AbstractReport.php @@ -38,7 +38,7 @@ abstract class AbstractReport extends \Magento\Framework\Model\Resource\Db\Abstr /** * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate * @param \Magento\Reports\Model\FlagFactory $reportsFlagFactory @@ -47,14 +47,14 @@ abstract class AbstractReport extends \Magento\Framework\Model\Resource\Db\Abstr */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, \Psr\Log\LoggerInterface $logger, \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate, \Magento\Reports\Model\FlagFactory $reportsFlagFactory, \Magento\Framework\Stdlib\DateTime $dateTime, \Magento\Framework\Stdlib\DateTime\Timezone\Validator $timezoneValidator ) { - parent::__construct($resource, $objectRelationProcessor); + parent::__construct($resource, $transactionManager); $this->_logger = $logger; $this->_localeDate = $localeDate; $this->_reportsFlagFactory = $reportsFlagFactory; diff --git a/app/code/Magento/Reports/Model/Resource/Report/Product/Viewed.php b/app/code/Magento/Reports/Model/Resource/Report/Product/Viewed.php index d3e9aa8695984..c164f637085ac 100644 --- a/app/code/Magento/Reports/Model/Resource/Report/Product/Viewed.php +++ b/app/code/Magento/Reports/Model/Resource/Report/Product/Viewed.php @@ -42,7 +42,7 @@ class Viewed extends \Magento\Sales\Model\Resource\Report\AbstractReport /** * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate * @param \Magento\Reports\Model\FlagFactory $reportsFlagFactory @@ -53,7 +53,7 @@ class Viewed extends \Magento\Sales\Model\Resource\Report\AbstractReport */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, \Psr\Log\LoggerInterface $logger, \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate, \Magento\Reports\Model\FlagFactory $reportsFlagFactory, @@ -64,7 +64,7 @@ public function __construct( ) { parent::__construct( $resource, - $objectRelationProcessor, + $transactionManager, $logger, $localeDate, $reportsFlagFactory, diff --git a/app/code/Magento/Review/Model/Resource/Rating.php b/app/code/Magento/Review/Model/Resource/Rating.php index 2676fd424f1d0..ce74e87665008 100644 --- a/app/code/Magento/Review/Model/Resource/Rating.php +++ b/app/code/Magento/Review/Model/Resource/Rating.php @@ -33,7 +33,7 @@ class Rating extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Module\Manager $moduleManager * @param \Magento\Framework\Store\StoreManagerInterface $storeManager @@ -41,7 +41,7 @@ class Rating extends \Magento\Framework\Model\Resource\Db\AbstractDb */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, \Psr\Log\LoggerInterface $logger, \Magento\Framework\Module\Manager $moduleManager, \Magento\Framework\Store\StoreManagerInterface $storeManager, @@ -51,7 +51,7 @@ public function __construct( $this->_storeManager = $storeManager; $this->_logger = $logger; $this->_reviewSummary = $reviewSummary; - parent::__construct($resource, $objectRelationProcessor); + parent::__construct($resource, $transactionManager); } /** diff --git a/app/code/Magento/Review/Model/Resource/Rating/Option.php b/app/code/Magento/Review/Model/Resource/Rating/Option.php index 7446d9e56d3a1..a842b3820f35d 100644 --- a/app/code/Magento/Review/Model/Resource/Rating/Option.php +++ b/app/code/Magento/Review/Model/Resource/Rating/Option.php @@ -80,14 +80,14 @@ class Option extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Review\Model\Rating\Option\VoteFactory $ratingOptionVoteF * @param \Magento\Framework\HTTP\PhpEnvironment\RemoteAddress $remoteAddress */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, \Magento\Customer\Model\Session $customerSession, \Magento\Review\Model\Rating\Option\VoteFactory $ratingOptionVoteF, \Magento\Framework\HTTP\PhpEnvironment\RemoteAddress $remoteAddress @@ -95,7 +95,7 @@ public function __construct( $this->_customerSession = $customerSession; $this->_ratingOptionVoteF = $ratingOptionVoteF; $this->_remoteAddress = $remoteAddress; - parent::__construct($resource, $objectRelationProcessor); + parent::__construct($resource, $transactionManager); } /** diff --git a/app/code/Magento/Review/Model/Resource/Review.php b/app/code/Magento/Review/Model/Resource/Review.php index 3387fa5f96c7c..a4e683b3cdf54 100644 --- a/app/code/Magento/Review/Model/Resource/Review.php +++ b/app/code/Magento/Review/Model/Resource/Review.php @@ -91,7 +91,7 @@ class Review extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param \Magento\Framework\Stdlib\DateTime\DateTime $date * @param \Magento\Framework\Store\StoreManagerInterface $storeManager * @param \Magento\Review\Model\RatingFactory $ratingFactory @@ -99,7 +99,7 @@ class Review extends \Magento\Framework\Model\Resource\Db\AbstractDb */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, \Magento\Framework\Stdlib\DateTime\DateTime $date, \Magento\Framework\Store\StoreManagerInterface $storeManager, \Magento\Review\Model\RatingFactory $ratingFactory, @@ -110,7 +110,7 @@ public function __construct( $this->_ratingFactory = $ratingFactory; $this->_ratingOptions = $ratingOptions; - parent::__construct($resource, $objectRelationProcessor); + parent::__construct($resource, $transactionManager); } /** diff --git a/app/code/Magento/Sales/Model/Resource/AbstractGrid.php b/app/code/Magento/Sales/Model/Resource/AbstractGrid.php index c04f8e0bf6bf9..6ca4d7fdfcf25 100644 --- a/app/code/Magento/Sales/Model/Resource/AbstractGrid.php +++ b/app/code/Magento/Sales/Model/Resource/AbstractGrid.php @@ -36,13 +36,13 @@ abstract class AbstractGrid extends AbstractDb implements GridInterface /** * @param AppResource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager */ public function __construct( AppResource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager ) { - parent::__construct($resource, $objectRelationProcessor); + parent::__construct($resource, $transactionManager); } /** diff --git a/app/code/Magento/Sales/Model/Resource/Entity.php b/app/code/Magento/Sales/Model/Resource/Entity.php index f7d820409d59f..de16c6f20326c 100644 --- a/app/code/Magento/Sales/Model/Resource/Entity.php +++ b/app/code/Magento/Sales/Model/Resource/Entity.php @@ -57,14 +57,14 @@ abstract class Entity extends AbstractDb /** * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param Attribute $attribute * @param \Magento\Sales\Model\Increment $salesIncrement * @param GridInterface|null $gridAggregator */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, \Magento\Sales\Model\Resource\Attribute $attribute, \Magento\Sales\Model\Increment $salesIncrement, \Magento\Sales\Model\Resource\GridInterface $gridAggregator = null @@ -72,7 +72,7 @@ public function __construct( $this->attribute = $attribute; $this->salesIncrement = $salesIncrement; $this->gridAggregator = $gridAggregator; - parent::__construct($resource, $objectRelationProcessor); + parent::__construct($resource, $transactionManager); } /** diff --git a/app/code/Magento/Sales/Model/Resource/Order.php b/app/code/Magento/Sales/Model/Resource/Order.php index a7c537a9a1da4..0bc4e34683f68 100644 --- a/app/code/Magento/Sales/Model/Resource/Order.php +++ b/app/code/Magento/Sales/Model/Resource/Order.php @@ -57,7 +57,7 @@ protected function _construct() /** * @param AppResource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param Attribute $attribute * @param SalesIncrement $salesIncrement * @param AddressHandler $addressHandler @@ -66,7 +66,7 @@ protected function _construct() */ public function __construct( AppResource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, Attribute $attribute, SalesIncrement $salesIncrement, AddressHandler $addressHandler, @@ -75,7 +75,7 @@ public function __construct( ) { $this->stateHandler = $stateHandler; $this->addressHandler = $addressHandler; - parent::__construct($resource, $objectRelationProcessor, $attribute, $salesIncrement, $gridAggregator); + parent::__construct($resource, $transactionManager, $attribute, $salesIncrement, $gridAggregator); } /** diff --git a/app/code/Magento/Sales/Model/Resource/Order/Address.php b/app/code/Magento/Sales/Model/Resource/Order/Address.php index 1d0facaf1c76c..67d44fdee196b 100644 --- a/app/code/Magento/Sales/Model/Resource/Order/Address.php +++ b/app/code/Magento/Sales/Model/Resource/Order/Address.php @@ -32,7 +32,7 @@ class Address extends SalesResource implements OrderAddressResourceInterface /** * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param \Magento\Sales\Model\Resource\Attribute $attribute * @param \Magento\Sales\Model\Increment $salesIncrement * @param \Magento\Sales\Model\Order\Address\Validator $validator @@ -41,7 +41,7 @@ class Address extends SalesResource implements OrderAddressResourceInterface */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, \Magento\Sales\Model\Resource\Attribute $attribute, \Magento\Sales\Model\Increment $salesIncrement, \Magento\Sales\Model\Order\Address\Validator $validator, @@ -50,7 +50,7 @@ public function __construct( ) { $this->_validator = $validator; $this->gridPool = $gridPool; - parent::__construct($resource, $objectRelationProcessor, $attribute, $salesIncrement, $gridAggregator); + parent::__construct($resource, $transactionManager, $attribute, $salesIncrement, $gridAggregator); } /** diff --git a/app/code/Magento/Sales/Model/Resource/Order/Creditmemo.php b/app/code/Magento/Sales/Model/Resource/Order/Creditmemo.php index e7970010f3ac1..42d32779ea580 100644 --- a/app/code/Magento/Sales/Model/Resource/Order/Creditmemo.php +++ b/app/code/Magento/Sales/Model/Resource/Order/Creditmemo.php @@ -40,19 +40,19 @@ protected function _construct() * Constructor * * @param AppResource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param Attribute $attribute * @param SalesIncrement $salesIncrement * @param CreditmemoGrid $gridAggregator */ public function __construct( AppResource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, Attribute $attribute, SalesIncrement $salesIncrement, CreditmemoGrid $gridAggregator ) { - parent::__construct($resource, $objectRelationProcessor, $attribute, $salesIncrement, $gridAggregator); + parent::__construct($resource, $transactionManager, $attribute, $salesIncrement, $gridAggregator); } /** diff --git a/app/code/Magento/Sales/Model/Resource/Order/Creditmemo/Comment.php b/app/code/Magento/Sales/Model/Resource/Order/Creditmemo/Comment.php index f839500452bc9..09b58d17c4939 100644 --- a/app/code/Magento/Sales/Model/Resource/Order/Creditmemo/Comment.php +++ b/app/code/Magento/Sales/Model/Resource/Order/Creditmemo/Comment.php @@ -31,7 +31,7 @@ class Comment extends Entity implements CreditmemoCommentResourceInterface /** * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param \Magento\Sales\Model\Resource\Attribute $attribute * @param \Magento\Sales\Model\Increment $salesIncrement * @param \Magento\Sales\Model\Order\Creditmemo\Comment\Validator $validator @@ -39,14 +39,14 @@ class Comment extends Entity implements CreditmemoCommentResourceInterface */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, \Magento\Sales\Model\Resource\Attribute $attribute, \Magento\Sales\Model\Increment $salesIncrement, \Magento\Sales\Model\Order\Creditmemo\Comment\Validator $validator, \Magento\Sales\Model\Resource\GridInterface $gridAggregator = null ) { $this->validator = $validator; - parent::__construct($resource, $objectRelationProcessor, $attribute, $salesIncrement, $gridAggregator); + parent::__construct($resource, $transactionManager, $attribute, $salesIncrement, $gridAggregator); } /** diff --git a/app/code/Magento/Sales/Model/Resource/Order/Invoice.php b/app/code/Magento/Sales/Model/Resource/Order/Invoice.php index c934d10b343c4..7e92d2bd2176a 100644 --- a/app/code/Magento/Sales/Model/Resource/Order/Invoice.php +++ b/app/code/Magento/Sales/Model/Resource/Order/Invoice.php @@ -36,19 +36,19 @@ protected function _construct() /** * @param Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param Attribute $attribute * @param SalesIncrement $salesIncrement * @param InvoiceGrid $gridAggregator */ public function __construct( Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, Attribute $attribute, SalesIncrement $salesIncrement, InvoiceGrid $gridAggregator ) { - parent::__construct($resource, $objectRelationProcessor, $attribute, $salesIncrement, $gridAggregator); + parent::__construct($resource, $transactionManager, $attribute, $salesIncrement, $gridAggregator); } /** diff --git a/app/code/Magento/Sales/Model/Resource/Order/Invoice/Comment.php b/app/code/Magento/Sales/Model/Resource/Order/Invoice/Comment.php index 5ea5f2fd9fa2c..c8cd4862a843d 100644 --- a/app/code/Magento/Sales/Model/Resource/Order/Invoice/Comment.php +++ b/app/code/Magento/Sales/Model/Resource/Order/Invoice/Comment.php @@ -31,7 +31,7 @@ class Comment extends Entity implements InvoiceCommentResourceInterface /** * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param \Magento\Sales\Model\Resource\Attribute $attribute * @param \Magento\Sales\Model\Increment $salesIncrement * @param \Magento\Sales\Model\Order\Invoice\Comment\Validator $validator @@ -39,14 +39,14 @@ class Comment extends Entity implements InvoiceCommentResourceInterface */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, \Magento\Sales\Model\Resource\Attribute $attribute, \Magento\Sales\Model\Increment $salesIncrement, \Magento\Sales\Model\Order\Invoice\Comment\Validator $validator, \Magento\Sales\Model\Resource\GridInterface $gridAggregator = null ) { $this->validator = $validator; - parent::__construct($resource, $objectRelationProcessor, $attribute, $salesIncrement, $gridAggregator); + parent::__construct($resource, $transactionManager, $attribute, $salesIncrement, $gridAggregator); } /** diff --git a/app/code/Magento/Sales/Model/Resource/Order/Shipment.php b/app/code/Magento/Sales/Model/Resource/Order/Shipment.php index bfbfce8b39ef1..b969e852c9b09 100644 --- a/app/code/Magento/Sales/Model/Resource/Order/Shipment.php +++ b/app/code/Magento/Sales/Model/Resource/Order/Shipment.php @@ -45,19 +45,19 @@ protected function _construct() /** * @param AppResource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param Attribute $attribute * @param SalesIncrement $salesIncrement * @param ShipmentGrid $gridAggregator */ public function __construct( AppResource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, Attribute $attribute, SalesIncrement $salesIncrement, ShipmentGrid $gridAggregator ) { - parent::__construct($resource, $objectRelationProcessor, $attribute, $salesIncrement, $gridAggregator); + parent::__construct($resource, $transactionManager, $attribute, $salesIncrement, $gridAggregator); } /** diff --git a/app/code/Magento/Sales/Model/Resource/Order/Shipment/Comment.php b/app/code/Magento/Sales/Model/Resource/Order/Shipment/Comment.php index 409079e71bb61..eba0aceba94c2 100644 --- a/app/code/Magento/Sales/Model/Resource/Order/Shipment/Comment.php +++ b/app/code/Magento/Sales/Model/Resource/Order/Shipment/Comment.php @@ -31,7 +31,7 @@ class Comment extends Entity implements ShipmentCommentResourceInterface /** * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param \Magento\Sales\Model\Resource\Attribute $attribute * @param \Magento\Sales\Model\Increment $salesIncrement * @param \Magento\Sales\Model\Order\Shipment\Comment\Validator $validator @@ -39,14 +39,14 @@ class Comment extends Entity implements ShipmentCommentResourceInterface */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, \Magento\Sales\Model\Resource\Attribute $attribute, \Magento\Sales\Model\Increment $salesIncrement, \Magento\Sales\Model\Order\Shipment\Comment\Validator $validator, \Magento\Sales\Model\Resource\GridInterface $gridAggregator = null ) { $this->validator = $validator; - parent::__construct($resource, $objectRelationProcessor, $attribute, $salesIncrement, $gridAggregator); + parent::__construct($resource, $transactionManager, $attribute, $salesIncrement, $gridAggregator); } /** diff --git a/app/code/Magento/Sales/Model/Resource/Order/Shipment/Track.php b/app/code/Magento/Sales/Model/Resource/Order/Shipment/Track.php index ca90ec49ad04b..c39bfa3f5bb04 100644 --- a/app/code/Magento/Sales/Model/Resource/Order/Shipment/Track.php +++ b/app/code/Magento/Sales/Model/Resource/Order/Shipment/Track.php @@ -31,7 +31,7 @@ class Track extends SalesResource implements ShipmentTrackResourceInterface /** * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param \Magento\Sales\Model\Resource\Attribute $attribute * @param \Magento\Sales\Model\Increment $salesIncrement * @param \Magento\Sales\Model\Order\Shipment\Track\Validator $validator @@ -39,14 +39,14 @@ class Track extends SalesResource implements ShipmentTrackResourceInterface */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, \Magento\Sales\Model\Resource\Attribute $attribute, \Magento\Sales\Model\Increment $salesIncrement, \Magento\Sales\Model\Order\Shipment\Track\Validator $validator, \Magento\Sales\Model\Resource\GridInterface $gridAggregator = null ) { $this->validator = $validator; - parent::__construct($resource, $objectRelationProcessor, $attribute, $salesIncrement, $gridAggregator); + parent::__construct($resource, $transactionManager, $attribute, $salesIncrement, $gridAggregator); } /** diff --git a/app/code/Magento/Sales/Model/Resource/Order/Status.php b/app/code/Magento/Sales/Model/Resource/Order/Status.php index 69cc3d6831373..5578c5cae5377 100644 --- a/app/code/Magento/Sales/Model/Resource/Order/Status.php +++ b/app/code/Magento/Sales/Model/Resource/Order/Status.php @@ -39,16 +39,16 @@ class Status extends \Magento\Framework\Model\Resource\Db\AbstractDb * Class constructor * * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param LogWriter $logger */ public function __construct( Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, LogWriter $logger ) { $this->logger = $logger; - parent::__construct($resource, $objectRelationProcessor); + parent::__construct($resource, $transactionManager); } /** diff --git a/app/code/Magento/Sales/Model/Resource/Order/Status/History.php b/app/code/Magento/Sales/Model/Resource/Order/Status/History.php index c97e78a4dc2d2..5ecca04a54948 100644 --- a/app/code/Magento/Sales/Model/Resource/Order/Status/History.php +++ b/app/code/Magento/Sales/Model/Resource/Order/Status/History.php @@ -23,7 +23,7 @@ class History extends Entity implements OrderStatusHistoryResourceInterface /** * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param \Magento\Framework\Stdlib\DateTime $dateTime * @param \Magento\Sales\Model\Resource\Attribute $attribute * @param \Magento\Sales\Model\Increment $salesIncrement @@ -32,14 +32,14 @@ class History extends Entity implements OrderStatusHistoryResourceInterface */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, \Magento\Sales\Model\Resource\Attribute $attribute, \Magento\Sales\Model\Increment $salesIncrement, Validator $validator, \Magento\Sales\Model\Resource\GridInterface $gridAggregator = null ) { $this->validator = $validator; - parent::__construct($resource, $objectRelationProcessor, $attribute, $salesIncrement, $gridAggregator); + parent::__construct($resource, $transactionManager, $attribute, $salesIncrement, $gridAggregator); } /** diff --git a/app/code/Magento/Sales/Model/Resource/Report/Bestsellers.php b/app/code/Magento/Sales/Model/Resource/Report/Bestsellers.php index 0d234567afa24..5078a5aa4170c 100644 --- a/app/code/Magento/Sales/Model/Resource/Report/Bestsellers.php +++ b/app/code/Magento/Sales/Model/Resource/Report/Bestsellers.php @@ -38,7 +38,7 @@ class Bestsellers extends AbstractReport /** * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate * @param \Magento\Reports\Model\FlagFactory $reportsFlagFactory @@ -50,7 +50,7 @@ class Bestsellers extends AbstractReport */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, \Psr\Log\LoggerInterface $logger, \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate, \Magento\Reports\Model\FlagFactory $reportsFlagFactory, @@ -62,7 +62,7 @@ public function __construct( ) { parent::__construct( $resource, - $objectRelationProcessor, + $transactionManager, $logger, $localeDate, $reportsFlagFactory, diff --git a/app/code/Magento/Sales/Model/Resource/Report/Order.php b/app/code/Magento/Sales/Model/Resource/Report/Order.php index 04c19acc4ac73..bc8fbe99dfed9 100644 --- a/app/code/Magento/Sales/Model/Resource/Report/Order.php +++ b/app/code/Magento/Sales/Model/Resource/Report/Order.php @@ -22,7 +22,7 @@ class Order extends AbstractReport /** * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate * @param \Magento\Reports\Model\FlagFactory $reportsFlagFactory @@ -33,7 +33,7 @@ class Order extends AbstractReport */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, \Psr\Log\LoggerInterface $logger, \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate, \Magento\Reports\Model\FlagFactory $reportsFlagFactory, @@ -44,7 +44,7 @@ public function __construct( ) { parent::__construct( $resource, - $objectRelationProcessor, + $transactionManager, $logger, $localeDate, $reportsFlagFactory, diff --git a/app/code/Magento/SalesRule/Model/Resource/Report/Rule.php b/app/code/Magento/SalesRule/Model/Resource/Report/Rule.php index b98b411e1bcae..e0fe6d7eac373 100644 --- a/app/code/Magento/SalesRule/Model/Resource/Report/Rule.php +++ b/app/code/Magento/SalesRule/Model/Resource/Report/Rule.php @@ -24,7 +24,7 @@ class Rule extends \Magento\Reports\Model\Resource\Report\AbstractReport /** * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate * @param \Magento\Reports\Model\FlagFactory $reportsFlagFactory @@ -35,7 +35,7 @@ class Rule extends \Magento\Reports\Model\Resource\Report\AbstractReport */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, \Psr\Log\LoggerInterface $logger, \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate, \Magento\Reports\Model\FlagFactory $reportsFlagFactory, @@ -46,7 +46,7 @@ public function __construct( ) { parent::__construct( $resource, - $objectRelationProcessor, + $transactionManager, $logger, $localeDate, $reportsFlagFactory, diff --git a/app/code/Magento/SalesRule/Model/Resource/Rule.php b/app/code/Magento/SalesRule/Model/Resource/Rule.php index fc23a9a8fe325..61f29e36670ad 100644 --- a/app/code/Magento/SalesRule/Model/Resource/Rule.php +++ b/app/code/Magento/SalesRule/Model/Resource/Rule.php @@ -44,19 +44,19 @@ class Rule extends \Magento\Rule\Model\Resource\AbstractResource /** * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param \Magento\Framework\Stdlib\String $string * @param \Magento\SalesRule\Model\Resource\Coupon $resourceCoupon */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, \Magento\Framework\Stdlib\String $string, \Magento\SalesRule\Model\Resource\Coupon $resourceCoupon ) { $this->string = $string; $this->_resourceCoupon = $resourceCoupon; - parent::__construct($resource, $objectRelationProcessor); + parent::__construct($resource, $transactionManager); } /** diff --git a/app/code/Magento/Search/Model/Resource/Query.php b/app/code/Magento/Search/Model/Resource/Query.php index 12cd84627bb65..62b17571ea1a8 100644 --- a/app/code/Magento/Search/Model/Resource/Query.php +++ b/app/code/Magento/Search/Model/Resource/Query.php @@ -32,19 +32,19 @@ class Query extends AbstractDb /** * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param \Magento\Framework\Stdlib\DateTime\DateTime $date * @param \Magento\Framework\Stdlib\DateTime $dateTime */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, \Magento\Framework\Stdlib\DateTime\DateTime $date, \Magento\Framework\Stdlib\DateTime $dateTime ) { $this->_date = $date; $this->dateTime = $dateTime; - parent::__construct($resource, $objectRelationProcessor); + parent::__construct($resource, $transactionManager); } /** diff --git a/app/code/Magento/Sitemap/Model/Resource/Catalog/Category.php b/app/code/Magento/Sitemap/Model/Resource/Catalog/Category.php index 495ff3541debd..c2d12ca0df954 100644 --- a/app/code/Magento/Sitemap/Model/Resource/Catalog/Category.php +++ b/app/code/Magento/Sitemap/Model/Resource/Catalog/Category.php @@ -40,19 +40,19 @@ class Category extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param \Magento\Framework\Store\StoreManagerInterface $storeManager * @param \Magento\Catalog\Model\Resource\Category $categoryResource */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, \Magento\Framework\Store\StoreManagerInterface $storeManager, \Magento\Catalog\Model\Resource\Category $categoryResource ) { $this->_storeManager = $storeManager; $this->_categoryResource = $categoryResource; - parent::__construct($resource, $objectRelationProcessor); + parent::__construct($resource, $transactionManager); } /** diff --git a/app/code/Magento/Sitemap/Model/Resource/Catalog/Product.php b/app/code/Magento/Sitemap/Model/Resource/Catalog/Product.php index a274abee15216..1362348715d00 100644 --- a/app/code/Magento/Sitemap/Model/Resource/Catalog/Product.php +++ b/app/code/Magento/Sitemap/Model/Resource/Catalog/Product.php @@ -84,7 +84,7 @@ class Product extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param \Magento\Sitemap\Helper\Data $sitemapData * @param \Magento\Catalog\Model\Resource\Product $productResource * @param \Magento\Framework\Store\StoreManagerInterface $storeManager @@ -96,7 +96,7 @@ class Product extends \Magento\Framework\Model\Resource\Db\AbstractDb */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, \Magento\Sitemap\Helper\Data $sitemapData, \Magento\Catalog\Model\Resource\Product $productResource, \Magento\Framework\Store\StoreManagerInterface $storeManager, @@ -114,7 +114,7 @@ public function __construct( $this->_eavConfigFactory = $eavConfigFactory; $this->_mediaConfig = $mediaConfig; $this->_sitemapData = $sitemapData; - parent::__construct($resource, $objectRelationProcessor); + parent::__construct($resource, $transactionManager); } /** diff --git a/app/code/Magento/Tax/Model/Resource/Calculation.php b/app/code/Magento/Tax/Model/Resource/Calculation.php index 2025b46dc5f00..46f972e1ef529 100644 --- a/app/code/Magento/Tax/Model/Resource/Calculation.php +++ b/app/code/Magento/Tax/Model/Resource/Calculation.php @@ -45,19 +45,19 @@ class Calculation extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\Framework\Store\StoreManagerInterface $storeManager */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, \Magento\Tax\Helper\Data $taxData, \Magento\Framework\Store\StoreManagerInterface $storeManager ) { $this->_taxData = $taxData; $this->_storeManager = $storeManager; - parent::__construct($resource, $objectRelationProcessor); + parent::__construct($resource, $transactionManager); } /** diff --git a/app/code/Magento/Tax/Model/Resource/Report/Tax.php b/app/code/Magento/Tax/Model/Resource/Report/Tax.php index 9ec166af18523..394036c31b7bf 100644 --- a/app/code/Magento/Tax/Model/Resource/Report/Tax.php +++ b/app/code/Magento/Tax/Model/Resource/Report/Tax.php @@ -23,7 +23,7 @@ class Tax extends \Magento\Reports\Model\Resource\Report\AbstractReport /** * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate * @param \Magento\Reports\Model\FlagFactory $reportsFlagFactory @@ -34,7 +34,7 @@ class Tax extends \Magento\Reports\Model\Resource\Report\AbstractReport */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, \Psr\Log\LoggerInterface $logger, \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate, \Magento\Reports\Model\FlagFactory $reportsFlagFactory, @@ -47,7 +47,7 @@ public function __construct( $this->_updatedAtFactory = $updatedAtFactory; parent::__construct( $resource, - $objectRelationProcessor, + $transactionManager, $logger, $localeDate, $reportsFlagFactory, diff --git a/app/code/Magento/Theme/Model/Resource/Design.php b/app/code/Magento/Theme/Model/Resource/Design.php index af1212ef4a4dc..e19fc35294791 100644 --- a/app/code/Magento/Theme/Model/Resource/Design.php +++ b/app/code/Magento/Theme/Model/Resource/Design.php @@ -23,16 +23,16 @@ class Design extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param DateTime $dateTime */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, DateTime $dateTime ) { $this->dateTime = $dateTime; - parent::__construct($resource, $objectRelationProcessor); + parent::__construct($resource, $transactionManager); } /** diff --git a/app/code/Magento/Translation/Model/Resource/String.php b/app/code/Magento/Translation/Model/Resource/String.php index 3aca226f31d59..8b4ce2f3b7ebd 100644 --- a/app/code/Magento/Translation/Model/Resource/String.php +++ b/app/code/Magento/Translation/Model/Resource/String.php @@ -24,14 +24,14 @@ class String extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param \Magento\Framework\Locale\ResolverInterface $localeResolver * @param \Magento\Framework\App\ScopeResolverInterface $scopeResolver * @param string|null $scope */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, \Magento\Framework\Locale\ResolverInterface $localeResolver, \Magento\Framework\App\ScopeResolverInterface $scopeResolver, $scope = null @@ -39,7 +39,7 @@ public function __construct( $this->_localeResolver = $localeResolver; $this->scopeResolver = $scopeResolver; $this->scope = $scope; - parent::__construct($resource, $objectRelationProcessor); + parent::__construct($resource, $transactionManager); } /** diff --git a/app/code/Magento/Translation/Model/Resource/Translate.php b/app/code/Magento/Translation/Model/Resource/Translate.php index 6d0cf41dd95cb..abaed90ca2ba9 100644 --- a/app/code/Magento/Translation/Model/Resource/Translate.php +++ b/app/code/Magento/Translation/Model/Resource/Translate.php @@ -20,19 +20,19 @@ class Translate extends \Magento\Framework\Model\Resource\Db\AbstractDb implemen /** * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param \Magento\Framework\App\ScopeResolverInterface $scopeResolver * @param null|string $scope */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, \Magento\Framework\App\ScopeResolverInterface $scopeResolver, $scope = null ) { $this->scopeResolver = $scopeResolver; $this->scope = $scope; - parent::__construct($resource, $objectRelationProcessor); + parent::__construct($resource, $transactionManager); } /** diff --git a/app/code/Magento/User/Model/Resource/User.php b/app/code/Magento/User/Model/Resource/User.php index 9bcbb25b2f1c9..778d7b4a08f29 100644 --- a/app/code/Magento/User/Model/Resource/User.php +++ b/app/code/Magento/User/Model/Resource/User.php @@ -47,19 +47,19 @@ class User extends \Magento\Framework\Model\Resource\Db\AbstractDb * Construct * * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param \Magento\Framework\Acl\CacheInterface $aclCache * @param \Magento\Authorization\Model\RoleFactory $roleFactory * @param \Magento\Framework\Stdlib\DateTime $dateTime */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, \Magento\Framework\Acl\CacheInterface $aclCache, \Magento\Authorization\Model\RoleFactory $roleFactory, \Magento\Framework\Stdlib\DateTime $dateTime ) { - parent::__construct($resource, $objectRelationProcessor); + parent::__construct($resource, $transactionManager); $this->_aclCache = $aclCache; $this->_roleFactory = $roleFactory; $this->dateTime = $dateTime; diff --git a/app/code/Magento/Weee/Model/Resource/Attribute/Backend/Weee/Tax.php b/app/code/Magento/Weee/Model/Resource/Attribute/Backend/Weee/Tax.php index 3e90a01ee225f..41e5d2b0b4ab9 100644 --- a/app/code/Magento/Weee/Model/Resource/Attribute/Backend/Weee/Tax.php +++ b/app/code/Magento/Weee/Model/Resource/Attribute/Backend/Weee/Tax.php @@ -19,16 +19,16 @@ class Tax extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param \Magento\Framework\Store\StoreManagerInterface $storeManager */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, \Magento\Framework\Store\StoreManagerInterface $storeManager ) { $this->_storeManager = $storeManager; - parent::__construct($resource, $objectRelationProcessor); + parent::__construct($resource, $transactionManager); } /** diff --git a/app/code/Magento/Weee/Model/Resource/Tax.php b/app/code/Magento/Weee/Model/Resource/Tax.php index ace1bebf1638a..d595de6e6f0a7 100644 --- a/app/code/Magento/Weee/Model/Resource/Tax.php +++ b/app/code/Magento/Weee/Model/Resource/Tax.php @@ -20,16 +20,16 @@ class Tax extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param \Magento\Framework\Stdlib\DateTime $dateTime */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, \Magento\Framework\Stdlib\DateTime $dateTime ) { $this->dateTime = $dateTime; - parent::__construct($resource, $objectRelationProcessor); + parent::__construct($resource, $transactionManager); } /** diff --git a/app/etc/di.xml b/app/etc/di.xml index 7808df1581a37..c2b3e5e959b53 100644 --- a/app/etc/di.xml +++ b/app/etc/di.xml @@ -87,8 +87,8 @@ - - + + Magento\Framework\Filesystem\Driver\File diff --git a/lib/internal/Magento/Framework/Model/Resource/Db/AbstractDb.php b/lib/internal/Magento/Framework/Model/Resource/Db/AbstractDb.php index b84790551ac03..8df0c08e2e55b 100644 --- a/lib/internal/Magento/Framework/Model/Resource/Db/AbstractDb.php +++ b/lib/internal/Magento/Framework/Model/Resource/Db/AbstractDb.php @@ -116,22 +116,28 @@ abstract class AbstractDb extends \Magento\Framework\Model\Resource\AbstractReso protected $_serializableFields = []; /** - * @var ObjectRelationProcessorInterface + * @var TransactionManagerInterface */ - protected $relationProcessor; + protected $transactionManager; + + /** + * @var ObjectRelationProcessor + */ + protected $objectRelationProcessor; /** - * Class constructor - * * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param TransactionManagerInterface $transactionManager + * @param ObjectRelationProcessor $objectRelationProcessor */ public function __construct( \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + TransactionManagerInterface $transactionManager, + ObjectRelationProcessor $objectRelationProcessor ) { - $this->relationProcessor = $objectRelationProcessor; + $this->transactionManager = $transactionManager; $this->_resources = $resource; + $this->objectRelationProcessor = $objectRelationProcessor; parent::__construct(); } @@ -398,7 +404,7 @@ public function save(\Magento\Framework\Model\AbstractModel $object) $object->beforeSave(); if ($object->isSaveAllowed()) { $this->_serializeFields($object); - $this->relationProcessor->validate($this->getMainTable(), $object->getData()); + $this->transactionManager->validate($this->getMainTable(), $object->getData()); $this->_beforeSave($object); $this->_checkUnique($object); if (!is_null($object->getId()) && (!$this->_useIsObjectNew || !$object->isObjectNew())) { @@ -464,27 +470,28 @@ public function save(\Magento\Framework\Model\AbstractModel $object) * * @param \Magento\Framework\Model\AbstractModel $object * @return $this + * @throws \Exception */ public function delete(\Magento\Framework\Model\AbstractModel $object) { - $this->relationProcessor->beginTransaction($this->_getWriteAdapter()); + $connection = $this->transactionManager->start($this->_getWriteAdapter()); try { $object->beforeDelete(); $this->_beforeDelete($object); - $this->relationProcessor->delete( - $this->_getWriteAdapter(), + $this->objectRelationProcessor->delete( + $connection, $this->getMainTable(), $this->_getWriteAdapter()->quoteInto($this->getIdFieldName() . '=?', $object->getId()), $object->getData() ); + $this->transactionManager->end($connection); $this->_afterDelete($object); - $object->isDeleted(true); $object->afterDelete(); - $this->relationProcessor->commit(); + $this->transactionManager->commit(); $object->afterDeleteCommit(); } catch (\Exception $e) { - $this->relationProcessor->rollBack(); + $this->transactionManager->rollBack(); throw $e; } return $this; diff --git a/lib/internal/Magento/Framework/Model/Resource/Db/ObjectRelationProcessor.php b/lib/internal/Magento/Framework/Model/Resource/Db/ObjectRelationProcessor.php index 11e00d1e77066..d11e463f3b1a2 100644 --- a/lib/internal/Magento/Framework/Model/Resource/Db/ObjectRelationProcessor.php +++ b/lib/internal/Magento/Framework/Model/Resource/Db/ObjectRelationProcessor.php @@ -8,56 +8,27 @@ use Magento\Framework\DB\Adapter\AdapterInterface as Connection; -class ObjectRelationProcessor implements ObjectRelationProcessorInterface +class ObjectRelationProcessor { /** - * @var Connection - */ - protected $connection = null; - - /** - * {@inheritdoc} - */ - public function delete(Connection $connection, $table, $condition, array $involvedData) - { - $connection->delete($table, $condition); - } - - /** - * {@inheritdoc} - */ - public function beginTransaction(Connection $connection) - { - $this->connection = $connection; - $this->connection->beginTransaction(); - } - - /** - * {@inheritdoc} - */ - public function commit() - { - $this->connection->commit(); - } - - /** - * {@inheritdoc} - */ - public function rollBack() - { - $this->connection->rollBack(); - } - - /** - * Validate data that is about to be saved. Check that referenced entity(s) exists. + * Process delete action * + * @param TransactionManagerInterface $transactionManager + * @param Connection $connection * @param string $table + * @param string $condition * @param array $involvedData * @return void * @throws \LogicException */ - public function validate($table, array $involvedData) - { - + public function delete( + TransactionManagerInterface $transactionManager, + Connection $connection, + $table, + $condition, + array $involvedData + ) { + $connection->delete($table, $condition); + $transactionManager->end($connection); } } diff --git a/lib/internal/Magento/Framework/Model/Resource/Db/TransactionManager.php b/lib/internal/Magento/Framework/Model/Resource/Db/TransactionManager.php new file mode 100644 index 0000000000000..a54cd97fe416e --- /dev/null +++ b/lib/internal/Magento/Framework/Model/Resource/Db/TransactionManager.php @@ -0,0 +1,74 @@ +delete($table, $condition); + } + + /** + * {@inheritdoc} + */ + public function start(Connection $connection) + { + $this->connection = $connection; + $this->connection->beginTransaction(); + } + + /** + * Vote that connection is ready to commit + * + * @param Connection $connection + * @return void + */ + public function end(Connection $connection) + { + + } + + /** + * {@inheritdoc} + */ + public function commit() + { + $this->connection->commit(); + } + + /** + * {@inheritdoc} + */ + public function rollBack() + { + $this->connection->rollBack(); + } + + /** + * Validate data that is about to be saved. Check that referenced entity(s) exists. + * + * @param string $table + * @param array $involvedData + * @return void + * @throws \LogicException + */ + public function validate($table, array $involvedData) + { + + } +} diff --git a/lib/internal/Magento/Framework/Model/Resource/Db/ObjectRelationProcessorInterface.php b/lib/internal/Magento/Framework/Model/Resource/Db/TransactionManagerInterface.php similarity index 80% rename from lib/internal/Magento/Framework/Model/Resource/Db/ObjectRelationProcessorInterface.php rename to lib/internal/Magento/Framework/Model/Resource/Db/TransactionManagerInterface.php index 43d0b4519e6e1..0ff1c3f810525 100644 --- a/lib/internal/Magento/Framework/Model/Resource/Db/ObjectRelationProcessorInterface.php +++ b/lib/internal/Magento/Framework/Model/Resource/Db/TransactionManagerInterface.php @@ -8,7 +8,7 @@ use Magento\Framework\DB\Adapter\AdapterInterface as Connection; -interface ObjectRelationProcessorInterface +interface TransactionManagerInterface { /** * Process delete operation @@ -35,9 +35,17 @@ public function validate($table, array $involvedData); * Start transaction * * @param Connection $connection + * @return Connection + */ + public function start(Connection $connection); + + /** + * Vote that connection is ready to commit + * + * @param Connection $connection * @return void */ - public function beginTransaction(Connection $connection); + public function end(Connection $connection); /** * Commit transaction diff --git a/setup/module/Magento/Setup/src/Module/SetupFactory.php b/setup/module/Magento/Setup/src/Module/SetupFactory.php index e881e7c2125b9..22ff5185a3c36 100644 --- a/setup/module/Magento/Setup/src/Module/SetupFactory.php +++ b/setup/module/Magento/Setup/src/Module/SetupFactory.php @@ -60,7 +60,7 @@ public function createSetupModule(LoggerInterface $log, $moduleName) $this->serviceLocator->get('Magento\Setup\Module\Setup\FileResolver'), $moduleName, $this->getResource(), - $this->serviceLocator->get('Magento\Framework\Model\Resource\Db\ObjectRelationProcessor') + $this->serviceLocator->get('Magento\Framework\Model\Resource\Db\TransactionManager') ); } diff --git a/setup/module/Magento/Setup/src/Module/SetupModule.php b/setup/module/Magento/Setup/src/Module/SetupModule.php index 9270f415c06ce..0430d1fd933f2 100644 --- a/setup/module/Magento/Setup/src/Module/SetupModule.php +++ b/setup/module/Magento/Setup/src/Module/SetupModule.php @@ -59,7 +59,7 @@ class SetupModule extends Setup * @param SetupFileResolver $fileResolver * @param string $moduleName * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor + * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager * @param string $connectionName */ public function __construct( @@ -68,14 +68,14 @@ public function __construct( SetupFileResolver $fileResolver, $moduleName, \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\ObjectRelationProcessorInterface $objectRelationProcessor, + \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, $connectionName = SetupInterface::DEFAULT_SETUP_CONNECTION ) { parent::__construct($resource, $connectionName); $this->logger = $log; $this->fileResolver = $fileResolver; $this->moduleConfig = $moduleList->getOne($moduleName); - $this->resource = new Resource($resource, $objectRelationProcessor); + $this->resource = new Resource($resource, $transactionManager); $this->resourceName = $this->fileResolver->getResourceCode($moduleName); } From b8c0a03b14a722fd0552b276fe494e8ddea05b05 Mon Sep 17 00:00:00 2001 From: Olexii Korshenko Date: Fri, 6 Feb 2015 15:24:26 +0200 Subject: [PATCH 16/44] MAGETWO-32974: DB Foreign Keys Management on the Application Level - added resource DB context object --- .../Authorization/Model/Resource/Role.php | 8 +-- .../Authorization/Model/Resource/Rules.php | 8 +-- .../Magento/Bundle/Model/Resource/Bundle.php | 8 +-- .../Magento/Bundle/Model/Resource/Option.php | 8 +-- .../Magento/Captcha/Model/Resource/Log.php | 8 +-- .../Catalog/Model/Resource/Attribute.php | 8 +-- .../Catalog/Model/Resource/Category/Flat.php | 8 +-- .../Magento/Catalog/Model/Resource/Config.php | 8 +-- .../Model/Resource/Layer/Filter/Price.php | 8 +-- .../Catalog/Model/Resource/Product/Flat.php | 8 +-- .../Product/Indexer/AbstractIndexer.php | 8 +-- .../Product/Indexer/Eav/AbstractEav.php | 8 +-- .../Resource/Product/Indexer/Eav/Source.php | 8 +-- .../Product/Indexer/Price/DefaultPrice.php | 8 +-- .../Catalog/Model/Resource/Product/Link.php | 8 +-- .../Catalog/Model/Resource/Product/Option.php | 8 +-- .../Model/Resource/Product/Option/Value.php | 8 +-- .../Model/Resource/Product/Website.php | 8 +-- .../Magento/Catalog/Model/Resource/Url.php | 8 +-- .../Resource/Indexer/Stock/DefaultStock.php | 8 +-- .../CatalogInventory/Model/Resource/Stock.php | 8 +-- .../Model/Resource/Stock/Item.php | 8 +-- .../Model/Resource/Stock/Status.php | 8 +-- .../CatalogRule/Model/Resource/Rule.php | 8 +-- .../CatalogSearch/Model/Resource/Advanced.php | 8 +-- .../CatalogSearch/Model/Resource/Engine.php | 8 +-- .../CatalogSearch/Model/Resource/Fulltext.php | 8 +-- .../Model/Resource/Agreement.php | 8 +-- app/code/Magento/Cms/Model/Resource/Block.php | 8 +-- app/code/Magento/Cms/Model/Resource/Page.php | 8 +-- .../Resource/Product/Type/Configurable.php | 8 +-- .../Product/Type/Configurable/Attribute.php | 8 +-- .../Model/Resource/File/Storage/Database.php | 8 +-- .../Core/Model/Resource/Layout/Update.php | 8 +-- .../Magento/Customer/Model/Resource/Group.php | 8 +-- .../Customer/Model/Resource/Visitor.php | 8 +-- .../Import/CustomerComposite/Data.php | 8 +-- .../Model/Theme/Resource/Change.php | 8 +-- .../Directory/Model/Resource/Region.php | 8 +-- .../Downloadable/Model/Resource/Link.php | 8 +-- .../Eav/Model/Resource/Entity/Attribute.php | 8 +-- .../Model/Resource/Entity/Attribute/Set.php | 8 +-- .../Magento/Email/Model/Resource/Template.php | 8 +-- .../Model/Resource/Import/Data.php | 8 +-- .../Model/Resource/Oauth/Consumer.php | 8 +-- .../Model/Resource/Oauth/Token.php | 8 +-- app/code/Magento/Log/Model/Resource/Log.php | 8 +-- .../Magento/Log/Model/Resource/Visitor.php | 8 +-- .../Log/Model/Resource/Visitor/Online.php | 8 +-- .../Newsletter/Model/Resource/Queue.php | 8 +-- .../Newsletter/Model/Resource/Subscriber.php | 8 +-- .../Newsletter/Model/Resource/Template.php | 8 +-- .../Model/Resource/Carrier/Tablerate.php | 8 +-- .../Persistent/Model/Resource/Session.php | 8 +-- .../ProductAlert/Model/Resource/Price.php | 8 +-- .../ProductAlert/Model/Resource/Stock.php | 8 +-- .../Magento/Quote/Model/Resource/Quote.php | 8 +-- .../Magento/Reports/Model/Resource/Event.php | 8 +-- .../Resource/Product/Index/AbstractIndex.php | 8 +-- .../Model/Resource/Report/AbstractReport.php | 8 +-- .../Model/Resource/Report/Product/Viewed.php | 9 +-- .../Magento/Review/Model/Resource/Rating.php | 8 +-- .../Review/Model/Resource/Rating/Option.php | 8 +-- .../Magento/Review/Model/Resource/Review.php | 8 +-- .../Sales/Model/Resource/AbstractGrid.php | 13 +--- .../Magento/Sales/Model/Resource/Entity.php | 8 +-- .../Magento/Sales/Model/Resource/Order.php | 8 +-- .../Sales/Model/Resource/Order/Address.php | 8 +-- .../Sales/Model/Resource/Order/Creditmemo.php | 8 +-- .../Resource/Order/Creditmemo/Comment.php | 8 +-- .../Sales/Model/Resource/Order/Invoice.php | 8 +-- .../Model/Resource/Order/Invoice/Comment.php | 8 +-- .../Sales/Model/Resource/Order/Shipment.php | 8 +-- .../Model/Resource/Order/Shipment/Comment.php | 8 +-- .../Model/Resource/Order/Shipment/Track.php | 8 +-- .../Sales/Model/Resource/Order/Status.php | 8 +-- .../Model/Resource/Order/Status/History.php | 8 +-- .../Model/Resource/Report/Bestsellers.php | 9 +-- .../Sales/Model/Resource/Report/Order.php | 9 +-- .../SalesRule/Model/Resource/Report/Rule.php | 9 +-- .../Magento/SalesRule/Model/Resource/Rule.php | 8 +-- .../Magento/Search/Model/Resource/Query.php | 8 +-- .../Model/Resource/Catalog/Category.php | 8 +-- .../Model/Resource/Catalog/Product.php | 8 +-- .../Tax/Model/Resource/Calculation.php | 8 +-- .../Magento/Tax/Model/Resource/Report/Tax.php | 9 +-- .../Magento/Theme/Model/Resource/Design.php | 8 +-- .../Translation/Model/Resource/String.php | 8 +-- .../Translation/Model/Resource/Translate.php | 8 +-- app/code/Magento/User/Model/Resource/User.php | 8 +-- .../Resource/Attribute/Backend/Weee/Tax.php | 8 +-- app/code/Magento/Weee/Model/Resource/Tax.php | 8 +-- .../Model/Resource/Db/AbstractDb.php | 19 ++---- .../Framework/Model/Resource/Db/Context.php | 64 +++++++++++++++++++ 94 files changed, 345 insertions(+), 484 deletions(-) create mode 100644 lib/internal/Magento/Framework/Model/Resource/Db/Context.php diff --git a/app/code/Magento/Authorization/Model/Resource/Role.php b/app/code/Magento/Authorization/Model/Resource/Role.php index 3c1a9311eef1c..7d2a388052c99 100644 --- a/app/code/Magento/Authorization/Model/Resource/Role.php +++ b/app/code/Magento/Authorization/Model/Resource/Role.php @@ -32,19 +32,17 @@ class Role extends \Magento\Framework\Model\Resource\Db\AbstractDb protected $dateTime; /** - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param \Magento\Framework\App\CacheInterface $cache * @param \Magento\Framework\Stdlib\DateTime $dateTime */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, \Magento\Framework\App\CacheInterface $cache, \Magento\Framework\Stdlib\DateTime $dateTime ) { $this->dateTime = $dateTime; - parent::__construct($resource, $transactionManager); + parent::__construct($context); $this->_cache = $cache->getFrontend(); } diff --git a/app/code/Magento/Authorization/Model/Resource/Rules.php b/app/code/Magento/Authorization/Model/Resource/Rules.php index c5c2de299151f..57acf7bb194ae 100644 --- a/app/code/Magento/Authorization/Model/Resource/Rules.php +++ b/app/code/Magento/Authorization/Model/Resource/Rules.php @@ -38,23 +38,21 @@ class Rules extends \Magento\Framework\Model\Resource\Db\AbstractDb protected $_logger; /** - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param \Magento\Framework\Acl\Builder $aclBuilder * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Acl\RootResource $rootResource * @param \Magento\Framework\Acl\CacheInterface $aclCache */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, \Magento\Framework\Acl\Builder $aclBuilder, \Psr\Log\LoggerInterface $logger, \Magento\Framework\Acl\RootResource $rootResource, \Magento\Framework\Acl\CacheInterface $aclCache ) { $this->_aclBuilder = $aclBuilder; - parent::__construct($resource, $transactionManager); + parent::__construct($context); $this->_rootResource = $rootResource; $this->_aclCache = $aclCache; $this->_logger = $logger; diff --git a/app/code/Magento/Bundle/Model/Resource/Bundle.php b/app/code/Magento/Bundle/Model/Resource/Bundle.php index b6cc7c895646d..2a21b6e4d194f 100644 --- a/app/code/Magento/Bundle/Model/Resource/Bundle.php +++ b/app/code/Magento/Bundle/Model/Resource/Bundle.php @@ -18,16 +18,14 @@ class Bundle extends \Magento\Framework\Model\Resource\Db\AbstractDb protected $_productRelation; /** - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param \Magento\Catalog\Model\Resource\Product\Relation $productRelation */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, \Magento\Catalog\Model\Resource\Product\Relation $productRelation ) { - parent::__construct($resource, $transactionManager); + parent::__construct($context); $this->_productRelation = $productRelation; } diff --git a/app/code/Magento/Bundle/Model/Resource/Option.php b/app/code/Magento/Bundle/Model/Resource/Option.php index 9767d877f358a..0a6522bca6fa5 100644 --- a/app/code/Magento/Bundle/Model/Resource/Option.php +++ b/app/code/Magento/Bundle/Model/Resource/Option.php @@ -18,16 +18,14 @@ class Option extends \Magento\Framework\Model\Resource\Db\AbstractDb private $validator; /** - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param \Magento\Bundle\Model\Option\Validator $validator */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, \Magento\Bundle\Model\Option\Validator $validator ) { - parent::__construct($resource, $transactionManager); + parent::__construct($context); $this->validator = $validator; } diff --git a/app/code/Magento/Captcha/Model/Resource/Log.php b/app/code/Magento/Captcha/Model/Resource/Log.php index 94fb433a8cdb6..e7f57dec39c80 100644 --- a/app/code/Magento/Captcha/Model/Resource/Log.php +++ b/app/code/Magento/Captcha/Model/Resource/Log.php @@ -35,20 +35,18 @@ class Log extends \Magento\Framework\Model\Resource\Db\AbstractDb protected $_remoteAddress; /** - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param \Magento\Framework\Stdlib\DateTime\DateTime $coreDate * @param \Magento\Framework\HTTP\PhpEnvironment\RemoteAddress $remoteAddress */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, \Magento\Framework\Stdlib\DateTime\DateTime $coreDate, \Magento\Framework\HTTP\PhpEnvironment\RemoteAddress $remoteAddress ) { $this->_coreDate = $coreDate; $this->_remoteAddress = $remoteAddress; - parent::__construct($resource, $transactionManager); + parent::__construct($context); } /** diff --git a/app/code/Magento/Catalog/Model/Resource/Attribute.php b/app/code/Magento/Catalog/Model/Resource/Attribute.php index b77c67a6e7798..a234183b8fdcd 100644 --- a/app/code/Magento/Catalog/Model/Resource/Attribute.php +++ b/app/code/Magento/Catalog/Model/Resource/Attribute.php @@ -27,16 +27,14 @@ class Attribute extends \Magento\Eav\Model\Resource\Entity\Attribute protected $attrLockValidator; /** - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param \Magento\Framework\Store\StoreManagerInterface $storeManager * @param \Magento\Eav\Model\Resource\Entity\Type $eavEntityType * @param \Magento\Eav\Model\Config $eavConfig * @param LockValidatorInterface $lockValidator */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, \Magento\Framework\Store\StoreManagerInterface $storeManager, \Magento\Eav\Model\Resource\Entity\Type $eavEntityType, \Magento\Eav\Model\Config $eavConfig, @@ -44,7 +42,7 @@ public function __construct( ) { $this->attrLockValidator = $lockValidator; $this->_eavConfig = $eavConfig; - parent::__construct($resource, $transactionManager, $storeManager, $eavEntityType); + parent::__construct($context, $storeManager, $eavEntityType); } /** diff --git a/app/code/Magento/Catalog/Model/Resource/Category/Flat.php b/app/code/Magento/Catalog/Model/Resource/Category/Flat.php index 1db04885a960a..59889e9acbdd4 100644 --- a/app/code/Magento/Catalog/Model/Resource/Category/Flat.php +++ b/app/code/Magento/Catalog/Model/Resource/Category/Flat.php @@ -78,8 +78,7 @@ class Flat extends \Magento\Indexer\Model\Resource\AbstractResource protected $_categoryFactory; /** - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param \Magento\Catalog\Model\CategoryFactory $categoryFactory * @param CollectionFactory $categoryCollectionFactory * @param \Magento\Framework\Store\StoreManagerInterface $storeManager @@ -87,8 +86,7 @@ class Flat extends \Magento\Indexer\Model\Resource\AbstractResource * @param \Magento\Framework\Event\ManagerInterface $eventManager */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, \Magento\Catalog\Model\CategoryFactory $categoryFactory, \Magento\Catalog\Model\Resource\Category\CollectionFactory $categoryCollectionFactory, \Magento\Framework\Store\StoreManagerInterface $storeManager, @@ -100,7 +98,7 @@ public function __construct( $this->_storeManager = $storeManager; $this->_catalogConfig = $catalogConfig; $this->_eventManager = $eventManager; - parent::__construct($resource, $transactionManager); + parent::__construct($context); } /** diff --git a/app/code/Magento/Catalog/Model/Resource/Config.php b/app/code/Magento/Catalog/Model/Resource/Config.php index 10e339209940f..6b8cc247ded2d 100644 --- a/app/code/Magento/Catalog/Model/Resource/Config.php +++ b/app/code/Magento/Catalog/Model/Resource/Config.php @@ -41,20 +41,18 @@ class Config extends \Magento\Framework\Model\Resource\Db\AbstractDb protected $_storeManager; /** - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param \Magento\Framework\Store\StoreManagerInterface $storeManager * @param \Magento\Eav\Model\Config $eavConfig */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, \Magento\Framework\Store\StoreManagerInterface $storeManager, \Magento\Eav\Model\Config $eavConfig ) { $this->_storeManager = $storeManager; $this->_eavConfig = $eavConfig; - parent::__construct($resource, $transactionManager); + parent::__construct($context); } /** diff --git a/app/code/Magento/Catalog/Model/Resource/Layer/Filter/Price.php b/app/code/Magento/Catalog/Model/Resource/Layer/Filter/Price.php index fcccb8629eb46..119ef64e61ae6 100644 --- a/app/code/Magento/Catalog/Model/Resource/Layer/Filter/Price.php +++ b/app/code/Magento/Catalog/Model/Resource/Layer/Filter/Price.php @@ -38,16 +38,14 @@ class Price extends \Magento\Framework\Model\Resource\Db\AbstractDb private $storeManager; /** - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Catalog\Model\Layer\Resolver $layerResolver * @param \Magento\Customer\Model\Session $session * @param \Magento\Framework\Store\StoreManagerInterface $storeManager */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Catalog\Model\Layer\Resolver $layerResolver, \Magento\Customer\Model\Session $session, @@ -57,7 +55,7 @@ public function __construct( $this->session = $session; $this->storeManager = $storeManager; $this->_eventManager = $eventManager; - parent::__construct($resource, $transactionManager); + parent::__construct($context); } /** diff --git a/app/code/Magento/Catalog/Model/Resource/Product/Flat.php b/app/code/Magento/Catalog/Model/Resource/Product/Flat.php index d8f2f6df99ed6..a58d31c826e36 100644 --- a/app/code/Magento/Catalog/Model/Resource/Product/Flat.php +++ b/app/code/Magento/Catalog/Model/Resource/Product/Flat.php @@ -36,20 +36,18 @@ class Flat extends \Magento\Framework\Model\Resource\Db\AbstractDb protected $_storeManager; /** - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param \Magento\Framework\Store\StoreManagerInterface $storeManager * @param \Magento\Catalog\Model\Config $catalogConfig */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, \Magento\Framework\Store\StoreManagerInterface $storeManager, \Magento\Catalog\Model\Config $catalogConfig ) { $this->_storeManager = $storeManager; $this->_catalogConfig = $catalogConfig; - parent::__construct($resource, $transactionManager); + parent::__construct($context); } /** diff --git a/app/code/Magento/Catalog/Model/Resource/Product/Indexer/AbstractIndexer.php b/app/code/Magento/Catalog/Model/Resource/Product/Indexer/AbstractIndexer.php index 55d7989e4fe59..b72de6e97b3ae 100644 --- a/app/code/Magento/Catalog/Model/Resource/Product/Indexer/AbstractIndexer.php +++ b/app/code/Magento/Catalog/Model/Resource/Product/Indexer/AbstractIndexer.php @@ -22,17 +22,15 @@ abstract class AbstractIndexer extends \Magento\Indexer\Model\Resource\AbstractR /** * Class constructor * - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param \Magento\Eav\Model\Config $eavConfig */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, \Magento\Eav\Model\Config $eavConfig ) { $this->_eavConfig = $eavConfig; - parent::__construct($resource, $transactionManager); + parent::__construct($context); } /** diff --git a/app/code/Magento/Catalog/Model/Resource/Product/Indexer/Eav/AbstractEav.php b/app/code/Magento/Catalog/Model/Resource/Product/Indexer/Eav/AbstractEav.php index a541551696f23..1496fd43657cd 100644 --- a/app/code/Magento/Catalog/Model/Resource/Product/Indexer/Eav/AbstractEav.php +++ b/app/code/Magento/Catalog/Model/Resource/Product/Indexer/Eav/AbstractEav.php @@ -22,19 +22,17 @@ abstract class AbstractEav extends \Magento\Catalog\Model\Resource\Product\Index /** * Construct * - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\Framework\Event\ManagerInterface $eventManager */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, \Magento\Eav\Model\Config $eavConfig, \Magento\Framework\Event\ManagerInterface $eventManager ) { $this->_eventManager = $eventManager; - parent::__construct($resource, $transactionManager, $eavConfig); + parent::__construct($context, $eavConfig); } /** diff --git a/app/code/Magento/Catalog/Model/Resource/Product/Indexer/Eav/Source.php b/app/code/Magento/Catalog/Model/Resource/Product/Indexer/Eav/Source.php index dd14390f604d4..b4161cfabe1ec 100644 --- a/app/code/Magento/Catalog/Model/Resource/Product/Indexer/Eav/Source.php +++ b/app/code/Magento/Catalog/Model/Resource/Product/Indexer/Eav/Source.php @@ -24,21 +24,19 @@ class Source extends AbstractEav /** * Construct * - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Catalog\Model\Resource\Helper $resourceHelper */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, \Magento\Eav\Model\Config $eavConfig, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Catalog\Model\Resource\Helper $resourceHelper ) { $this->_resourceHelper = $resourceHelper; - parent::__construct($resource, $transactionManager, $eavConfig, $eventManager); + parent::__construct($context, $eavConfig, $eventManager); } /** diff --git a/app/code/Magento/Catalog/Model/Resource/Product/Indexer/Price/DefaultPrice.php b/app/code/Magento/Catalog/Model/Resource/Product/Indexer/Price/DefaultPrice.php index 90f4f84403b68..6513123c1aa58 100644 --- a/app/code/Magento/Catalog/Model/Resource/Product/Indexer/Price/DefaultPrice.php +++ b/app/code/Magento/Catalog/Model/Resource/Product/Indexer/Price/DefaultPrice.php @@ -42,22 +42,20 @@ class DefaultPrice extends \Magento\Catalog\Model\Resource\Product\Indexer\Abstr protected $_eventManager = null; /** - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Framework\Module\Manager $moduleManager */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, \Magento\Eav\Model\Config $eavConfig, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Framework\Module\Manager $moduleManager ) { $this->_eventManager = $eventManager; $this->moduleManager = $moduleManager; - parent::__construct($resource, $transactionManager, $eavConfig); + parent::__construct($context, $eavConfig); } /** diff --git a/app/code/Magento/Catalog/Model/Resource/Product/Link.php b/app/code/Magento/Catalog/Model/Resource/Product/Link.php index 6e11f7aa548c6..84a582c1ff86c 100644 --- a/app/code/Magento/Catalog/Model/Resource/Product/Link.php +++ b/app/code/Magento/Catalog/Model/Resource/Product/Link.php @@ -27,17 +27,15 @@ class Link extends \Magento\Framework\Model\Resource\Db\AbstractDb protected $_catalogProductRelation; /** - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param Relation $catalogProductRelation */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, Relation $catalogProductRelation ) { $this->_catalogProductRelation = $catalogProductRelation; - parent::__construct($resource, $transactionManager); + parent::__construct($context); } /** diff --git a/app/code/Magento/Catalog/Model/Resource/Product/Option.php b/app/code/Magento/Catalog/Model/Resource/Product/Option.php index fcdca6da8a079..759123ad3a021 100644 --- a/app/code/Magento/Catalog/Model/Resource/Product/Option.php +++ b/app/code/Magento/Catalog/Model/Resource/Product/Option.php @@ -36,15 +36,13 @@ class Option extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * Class constructor * - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param \Magento\Directory\Model\CurrencyFactory $currencyFactory * @param \Magento\Framework\Store\StoreManagerInterface $storeManager * @param \Magento\Framework\App\Config\ScopeConfigInterface $config */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, \Magento\Directory\Model\CurrencyFactory $currencyFactory, \Magento\Framework\Store\StoreManagerInterface $storeManager, \Magento\Framework\App\Config\ScopeConfigInterface $config @@ -52,7 +50,7 @@ public function __construct( $this->_currencyFactory = $currencyFactory; $this->_storeManager = $storeManager; $this->_config = $config; - parent::__construct($resource, $transactionManager); + parent::__construct($context); } /** diff --git a/app/code/Magento/Catalog/Model/Resource/Product/Option/Value.php b/app/code/Magento/Catalog/Model/Resource/Product/Option/Value.php index 6586e5d045922..035ea10a2a32c 100644 --- a/app/code/Magento/Catalog/Model/Resource/Product/Option/Value.php +++ b/app/code/Magento/Catalog/Model/Resource/Product/Option/Value.php @@ -36,15 +36,13 @@ class Value extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * Class constructor * - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param \Magento\Directory\Model\CurrencyFactory $currencyFactory * @param \Magento\Framework\Store\StoreManagerInterface $storeManager * @param \Magento\Framework\App\Config\ScopeConfigInterface $config */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, \Magento\Directory\Model\CurrencyFactory $currencyFactory, \Magento\Framework\Store\StoreManagerInterface $storeManager, \Magento\Framework\App\Config\ScopeConfigInterface $config @@ -52,7 +50,7 @@ public function __construct( $this->_currencyFactory = $currencyFactory; $this->_storeManager = $storeManager; $this->_config = $config; - parent::__construct($resource, $transactionManager); + parent::__construct($context); } /** diff --git a/app/code/Magento/Catalog/Model/Resource/Product/Website.php b/app/code/Magento/Catalog/Model/Resource/Product/Website.php index 773c2802d3c5c..6f620f6ce916a 100644 --- a/app/code/Magento/Catalog/Model/Resource/Product/Website.php +++ b/app/code/Magento/Catalog/Model/Resource/Product/Website.php @@ -18,17 +18,15 @@ class Website extends \Magento\Framework\Model\Resource\Db\AbstractDb protected $_storeManager; /** - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param \Magento\Framework\Store\StoreManagerInterface $storeManager */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, \Magento\Framework\Store\StoreManagerInterface $storeManager ) { $this->_storeManager = $storeManager; - parent::__construct($resource, $transactionManager); + parent::__construct($context); } /** diff --git a/app/code/Magento/Catalog/Model/Resource/Url.php b/app/code/Magento/Catalog/Model/Resource/Url.php index d82c91066c940..de099beaa978e 100644 --- a/app/code/Magento/Catalog/Model/Resource/Url.php +++ b/app/code/Magento/Catalog/Model/Resource/Url.php @@ -88,8 +88,7 @@ class Url extends \Magento\Framework\Model\Resource\Db\AbstractDb protected $productResource; /** - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param \Magento\Framework\Store\StoreManagerInterface $storeManager * @param \Magento\Eav\Model\Config $eavConfig * @param Product $productResource @@ -97,8 +96,7 @@ class Url extends \Magento\Framework\Model\Resource\Db\AbstractDb * @param \Psr\Log\LoggerInterface $logger */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, \Magento\Framework\Store\StoreManagerInterface $storeManager, \Magento\Eav\Model\Config $eavConfig, Product $productResource, @@ -110,7 +108,7 @@ public function __construct( $this->productResource = $productResource; $this->_catalogCategory = $catalogCategory; $this->_logger = $logger; - parent::__construct($resource, $transactionManager); + parent::__construct($context); } /** diff --git a/app/code/Magento/CatalogInventory/Model/Resource/Indexer/Stock/DefaultStock.php b/app/code/Magento/CatalogInventory/Model/Resource/Indexer/Stock/DefaultStock.php index 97f9788d5bb78..8fefae22d3f68 100644 --- a/app/code/Magento/CatalogInventory/Model/Resource/Indexer/Stock/DefaultStock.php +++ b/app/code/Magento/CatalogInventory/Model/Resource/Indexer/Stock/DefaultStock.php @@ -35,19 +35,17 @@ class DefaultStock extends \Magento\Catalog\Model\Resource\Product\Indexer\Abstr /** * Class constructor * - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, \Magento\Eav\Model\Config $eavConfig, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig ) { $this->_scopeConfig = $scopeConfig; - parent::__construct($resource, $transactionManager, $eavConfig); + parent::__construct($context, $eavConfig); } /** diff --git a/app/code/Magento/CatalogInventory/Model/Resource/Stock.php b/app/code/Magento/CatalogInventory/Model/Resource/Stock.php index 35430da4523c1..32dbb0022a5e0 100644 --- a/app/code/Magento/CatalogInventory/Model/Resource/Stock.php +++ b/app/code/Magento/CatalogInventory/Model/Resource/Stock.php @@ -79,22 +79,20 @@ class Stock extends \Magento\Framework\Model\Resource\Db\AbstractDb protected $storeManager; /** - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Framework\Stdlib\DateTime $dateTime * @param StockConfigurationInterface $stockConfiguration * @param StoreManagerInterface $storeManager */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Framework\Stdlib\DateTime $dateTime, StockConfigurationInterface $stockConfiguration, StoreManagerInterface $storeManager ) { - parent::__construct($resource, $transactionManager); + parent::__construct($context); $this->_scopeConfig = $scopeConfig; $this->dateTime = $dateTime; $this->stockConfiguration = $stockConfiguration; diff --git a/app/code/Magento/CatalogInventory/Model/Resource/Stock/Item.php b/app/code/Magento/CatalogInventory/Model/Resource/Stock/Item.php index 1c9888e1a7342..0fe820da9de09 100644 --- a/app/code/Magento/CatalogInventory/Model/Resource/Stock/Item.php +++ b/app/code/Magento/CatalogInventory/Model/Resource/Stock/Item.php @@ -29,17 +29,15 @@ class Item extends \Magento\Framework\Model\Resource\Db\AbstractDb protected $stockIndexerProcessor; /** - * @param AppResource $resource - * @param TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param Processor $processor */ public function __construct( - AppResource $resource, - TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, Processor $processor ) { $this->stockIndexerProcessor = $processor; - parent::__construct($resource, $transactionManager); + parent::__construct($context); } /** diff --git a/app/code/Magento/CatalogInventory/Model/Resource/Stock/Status.php b/app/code/Magento/CatalogInventory/Model/Resource/Stock/Status.php index a4c130c891e99..39714d2c559cb 100644 --- a/app/code/Magento/CatalogInventory/Model/Resource/Stock/Status.php +++ b/app/code/Magento/CatalogInventory/Model/Resource/Stock/Status.php @@ -32,20 +32,18 @@ class Status extends \Magento\Framework\Model\Resource\Db\AbstractDb protected $eavConfig; /** - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param \Magento\Framework\Store\StoreManagerInterface $storeManager * @param \Magento\Store\Model\WebsiteFactory $websiteFactory * @param \Magento\Eav\Model\Config $eavConfig */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, \Magento\Framework\Store\StoreManagerInterface $storeManager, \Magento\Store\Model\WebsiteFactory $websiteFactory, \Magento\Eav\Model\Config $eavConfig ) { - parent::__construct($resource, $transactionManager); + parent::__construct($context); $this->_storeManager = $storeManager; $this->_websiteFactory = $websiteFactory; diff --git a/app/code/Magento/CatalogRule/Model/Resource/Rule.php b/app/code/Magento/CatalogRule/Model/Resource/Rule.php index b0ffac45b0733..f698b7f1d67cd 100644 --- a/app/code/Magento/CatalogRule/Model/Resource/Rule.php +++ b/app/code/Magento/CatalogRule/Model/Resource/Rule.php @@ -93,8 +93,7 @@ class Rule extends \Magento\Rule\Model\Resource\AbstractResource protected $priceCurrency; /** - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param \Magento\Framework\Store\StoreManagerInterface $storeManager * @param Product\ConditionFactory $conditionFactory * @param \Magento\Framework\Stdlib\DateTime\DateTime $coreDate @@ -107,8 +106,7 @@ class Rule extends \Magento\Rule\Model\Resource\AbstractResource * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, \Magento\Framework\Store\StoreManagerInterface $storeManager, \Magento\Catalog\Model\Product\ConditionFactory $conditionFactory, \Magento\Framework\Stdlib\DateTime\DateTime $coreDate, @@ -128,7 +126,7 @@ public function __construct( $this->_logger = $logger; $this->dateTime = $dateTime; $this->priceCurrency = $priceCurrency; - parent::__construct($resource, $transactionManager); + parent::__construct($context); } /** diff --git a/app/code/Magento/CatalogSearch/Model/Resource/Advanced.php b/app/code/Magento/CatalogSearch/Model/Resource/Advanced.php index 7d81a5d787fd2..916e9e1954436 100644 --- a/app/code/Magento/CatalogSearch/Model/Resource/Advanced.php +++ b/app/code/Magento/CatalogSearch/Model/Resource/Advanced.php @@ -29,20 +29,18 @@ class Advanced extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * Construct * - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param \Magento\Framework\Store\StoreManagerInterface $storeManager * @param \Magento\Framework\Event\ManagerInterface $eventManager */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, \Magento\Framework\Store\StoreManagerInterface $storeManager, \Magento\Framework\Event\ManagerInterface $eventManager ) { $this->_storeManager = $storeManager; $this->_eventManager = $eventManager; - parent::__construct($resource, $transactionManager); + parent::__construct($context); } /** diff --git a/app/code/Magento/CatalogSearch/Model/Resource/Engine.php b/app/code/Magento/CatalogSearch/Model/Resource/Engine.php index a021c1e2a475a..ccce08e9e96fa 100644 --- a/app/code/Magento/CatalogSearch/Model/Resource/Engine.php +++ b/app/code/Magento/CatalogSearch/Model/Resource/Engine.php @@ -47,16 +47,14 @@ class Engine extends AbstractDb implements EngineInterface /** * Construct * - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param \Magento\Catalog\Model\Product\Visibility $catalogProductVisibility * @param Advanced $searchResource * @param \Magento\CatalogSearch\Helper\Data $catalogSearchData * @param \Magento\Search\Model\Resource\Helper $resourceHelper */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, \Magento\Catalog\Model\Product\Visibility $catalogProductVisibility, \Magento\CatalogSearch\Model\Resource\Advanced $searchResource, \Magento\CatalogSearch\Helper\Data $catalogSearchData, @@ -66,7 +64,7 @@ public function __construct( $this->_searchResource = $searchResource; $this->_catalogSearchData = $catalogSearchData; $this->_resourceHelper = $resourceHelper; - parent::__construct($resource, $transactionManager); + parent::__construct($context); } /** diff --git a/app/code/Magento/CatalogSearch/Model/Resource/Fulltext.php b/app/code/Magento/CatalogSearch/Model/Resource/Fulltext.php index eae9f2cfb965d..aecbda13dad75 100644 --- a/app/code/Magento/CatalogSearch/Model/Resource/Fulltext.php +++ b/app/code/Magento/CatalogSearch/Model/Resource/Fulltext.php @@ -34,15 +34,13 @@ class Fulltext extends \Magento\Framework\Model\Resource\Db\AbstractDb protected $_resourceHelper; /** - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Framework\Filter\FilterManager $filter * @param Helper $resourceHelper */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Framework\Filter\FilterManager $filter, \Magento\Search\Model\Resource\Helper $resourceHelper @@ -50,7 +48,7 @@ public function __construct( $this->_eventManager = $eventManager; $this->filter = $filter; $this->_resourceHelper = $resourceHelper; - parent::__construct($resource, $transactionManager); + parent::__construct($context); } /** diff --git a/app/code/Magento/CheckoutAgreements/Model/Resource/Agreement.php b/app/code/Magento/CheckoutAgreements/Model/Resource/Agreement.php index 465fd64e0879d..98286319d108e 100644 --- a/app/code/Magento/CheckoutAgreements/Model/Resource/Agreement.php +++ b/app/code/Magento/CheckoutAgreements/Model/Resource/Agreement.php @@ -19,17 +19,15 @@ class Agreement extends \Magento\Framework\Model\Resource\Db\AbstractDb protected $filterManager; /** - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param \Magento\Framework\Filter\FilterManager $filterManager */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, \Magento\Framework\Filter\FilterManager $filterManager ) { $this->filterManager = $filterManager; - parent::__construct($resource, $transactionManager); + parent::__construct($context); } /** diff --git a/app/code/Magento/Cms/Model/Resource/Block.php b/app/code/Magento/Cms/Model/Resource/Block.php index 6de1556cdb0cd..1e0da90f487b8 100644 --- a/app/code/Magento/Cms/Model/Resource/Block.php +++ b/app/code/Magento/Cms/Model/Resource/Block.php @@ -25,18 +25,16 @@ class Block extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * Construct * - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param \Magento\Framework\Stdlib\DateTime\DateTime $date * @param \Magento\Framework\Store\StoreManagerInterface $storeManager */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, \Magento\Framework\Stdlib\DateTime\DateTime $date, \Magento\Framework\Store\StoreManagerInterface $storeManager ) { - parent::__construct($resource, $transactionManager); + parent::__construct($context); $this->_storeManager = $storeManager; $this->_date = $date; } diff --git a/app/code/Magento/Cms/Model/Resource/Page.php b/app/code/Magento/Cms/Model/Resource/Page.php index 1fecc2a304ffe..2285d72645499 100644 --- a/app/code/Magento/Cms/Model/Resource/Page.php +++ b/app/code/Magento/Cms/Model/Resource/Page.php @@ -40,20 +40,18 @@ class Page extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * Construct * - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param \Magento\Framework\Stdlib\DateTime\DateTime $date * @param \Magento\Framework\Store\StoreManagerInterface $storeManager * @param \Magento\Framework\Stdlib\DateTime $dateTime */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, \Magento\Framework\Stdlib\DateTime\DateTime $date, \Magento\Framework\Store\StoreManagerInterface $storeManager, \Magento\Framework\Stdlib\DateTime $dateTime ) { - parent::__construct($resource, $transactionManager); + parent::__construct($context); $this->_date = $date; $this->_storeManager = $storeManager; $this->dateTime = $dateTime; diff --git a/app/code/Magento/ConfigurableProduct/Model/Resource/Product/Type/Configurable.php b/app/code/Magento/ConfigurableProduct/Model/Resource/Product/Type/Configurable.php index c4c1ae1507343..d5394c008b98e 100644 --- a/app/code/Magento/ConfigurableProduct/Model/Resource/Product/Type/Configurable.php +++ b/app/code/Magento/ConfigurableProduct/Model/Resource/Product/Type/Configurable.php @@ -17,17 +17,15 @@ class Configurable extends \Magento\Framework\Model\Resource\Db\AbstractDb protected $_catalogProductRelation; /** - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param \Magento\Catalog\Model\Resource\Product\Relation $catalogProductRelation */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, \Magento\Catalog\Model\Resource\Product\Relation $catalogProductRelation ) { $this->_catalogProductRelation = $catalogProductRelation; - parent::__construct($resource, $transactionManager); + parent::__construct($context); } /** diff --git a/app/code/Magento/ConfigurableProduct/Model/Resource/Product/Type/Configurable/Attribute.php b/app/code/Magento/ConfigurableProduct/Model/Resource/Product/Type/Configurable/Attribute.php index d8b1977671239..dda07afae4eab 100644 --- a/app/code/Magento/ConfigurableProduct/Model/Resource/Product/Type/Configurable/Attribute.php +++ b/app/code/Magento/ConfigurableProduct/Model/Resource/Product/Type/Configurable/Attribute.php @@ -40,20 +40,18 @@ class Attribute extends \Magento\Framework\Model\Resource\Db\AbstractDb protected $_storeManager; /** - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param \Magento\Framework\Store\StoreManagerInterface $storeManager * @param \Magento\Catalog\Helper\Data $catalogData */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, \Magento\Framework\Store\StoreManagerInterface $storeManager, \Magento\Catalog\Helper\Data $catalogData ) { $this->_storeManager = $storeManager; $this->_catalogData = $catalogData; - parent::__construct($resource, $transactionManager); + parent::__construct($context); } /** diff --git a/app/code/Magento/Core/Model/Resource/File/Storage/Database.php b/app/code/Magento/Core/Model/Resource/File/Storage/Database.php index d9a274a81e75d..b5a2a3efddc0d 100644 --- a/app/code/Magento/Core/Model/Resource/File/Storage/Database.php +++ b/app/code/Magento/Core/Model/Resource/File/Storage/Database.php @@ -16,16 +16,14 @@ class Database extends \Magento\Core\Model\Resource\File\Storage\AbstractStorage protected $_resourceHelper; /** - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param \Magento\Framework\DB\Helper $resourceHelper */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, \Magento\Framework\DB\Helper $resourceHelper ) { - parent::__construct($resource, $transactionManager); + parent::__construct($context); $this->_resourceHelper = $resourceHelper; } diff --git a/app/code/Magento/Core/Model/Resource/Layout/Update.php b/app/code/Magento/Core/Model/Resource/Layout/Update.php index aee0062ad6eb6..b7d916f3a5166 100644 --- a/app/code/Magento/Core/Model/Resource/Layout/Update.php +++ b/app/code/Magento/Core/Model/Resource/Layout/Update.php @@ -19,16 +19,14 @@ class Update extends \Magento\Framework\Model\Resource\Db\AbstractDb private $_cache; /** - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param \Magento\Framework\Cache\FrontendInterface $cache */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, \Magento\Framework\Cache\FrontendInterface $cache ) { - parent::__construct($resource, $transactionManager); + parent::__construct($context); $this->_cache = $cache; } diff --git a/app/code/Magento/Customer/Model/Resource/Group.php b/app/code/Magento/Customer/Model/Resource/Group.php index 82c1889dcdc05..e860656842b2a 100644 --- a/app/code/Magento/Customer/Model/Resource/Group.php +++ b/app/code/Magento/Customer/Model/Resource/Group.php @@ -25,20 +25,18 @@ class Group extends \Magento\Framework\Model\Resource\Db\AbstractDb protected $_customersFactory; /** - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param \Magento\Customer\Api\GroupManagementInterface $groupManagement * @param Customer\CollectionFactory $customersFactory */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, \Magento\Customer\Api\GroupManagementInterface $groupManagement, \Magento\Customer\Model\Resource\Customer\CollectionFactory $customersFactory ) { $this->_groupManagement = $groupManagement; $this->_customersFactory = $customersFactory; - parent::__construct($resource, $transactionManager); + parent::__construct($context); } /** diff --git a/app/code/Magento/Customer/Model/Resource/Visitor.php b/app/code/Magento/Customer/Model/Resource/Visitor.php index 3f296818071f9..3e27caedb4b5f 100644 --- a/app/code/Magento/Customer/Model/Resource/Visitor.php +++ b/app/code/Magento/Customer/Model/Resource/Visitor.php @@ -23,20 +23,18 @@ class Visitor extends \Magento\Framework\Model\Resource\Db\AbstractDb protected $dateTime; /** - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param \Magento\Framework\Stdlib\DateTime\DateTime $date * @param \Magento\Framework\Stdlib\DateTime $dateTime */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, \Magento\Framework\Stdlib\DateTime\DateTime $date, \Magento\Framework\Stdlib\DateTime $dateTime ) { $this->date = $date; $this->dateTime = $dateTime; - parent::__construct($resource, $transactionManager); + parent::__construct($context); } /** diff --git a/app/code/Magento/CustomerImportExport/Model/Resource/Import/CustomerComposite/Data.php b/app/code/Magento/CustomerImportExport/Model/Resource/Import/CustomerComposite/Data.php index 91ffac5f60098..6f4a1a8ee4ffe 100644 --- a/app/code/Magento/CustomerImportExport/Model/Resource/Import/CustomerComposite/Data.php +++ b/app/code/Magento/CustomerImportExport/Model/Resource/Import/CustomerComposite/Data.php @@ -26,18 +26,16 @@ class Data extends \Magento\ImportExport\Model\Resource\Import\Data /** * Class constructor * - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param \Magento\Core\Helper\Data $coreHelper * @param array $arguments */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, \Magento\Core\Helper\Data $coreHelper, array $arguments = [] ) { - parent::__construct($resource, $transactionManager, $coreHelper, $arguments); + parent::__construct($context, $coreHelper, $arguments); if (isset($arguments['entity_type'])) { $this->_entityType = $arguments['entity_type']; diff --git a/app/code/Magento/DesignEditor/Model/Theme/Resource/Change.php b/app/code/Magento/DesignEditor/Model/Theme/Resource/Change.php index e2b36ee26f1f9..1449c52a00c85 100644 --- a/app/code/Magento/DesignEditor/Model/Theme/Resource/Change.php +++ b/app/code/Magento/DesignEditor/Model/Theme/Resource/Change.php @@ -16,18 +16,16 @@ class Change extends \Magento\Framework\Model\Resource\Db\AbstractDb protected $dateTime; /** - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param \Magento\Framework\Stdlib\DateTime $dateTime * @return void */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, \Magento\Framework\Stdlib\DateTime $dateTime ) { $this->dateTime = $dateTime; - parent::__construct($resource, $transactionManager); + parent::__construct($context); } /** diff --git a/app/code/Magento/Directory/Model/Resource/Region.php b/app/code/Magento/Directory/Model/Resource/Region.php index 1e2cc1a38065e..2aa9544d5f9b3 100644 --- a/app/code/Magento/Directory/Model/Resource/Region.php +++ b/app/code/Magento/Directory/Model/Resource/Region.php @@ -26,16 +26,14 @@ class Region extends \Magento\Framework\Model\Resource\Db\AbstractDb protected $_localeResolver; /** - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param \Magento\Framework\Locale\ResolverInterface $localeResolver */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, \Magento\Framework\Locale\ResolverInterface $localeResolver ) { - parent::__construct($resource, $transactionManager); + parent::__construct($context); $this->_localeResolver = $localeResolver; } diff --git a/app/code/Magento/Downloadable/Model/Resource/Link.php b/app/code/Magento/Downloadable/Model/Resource/Link.php index b10a06988bf0e..046e5a407a4ac 100644 --- a/app/code/Magento/Downloadable/Model/Resource/Link.php +++ b/app/code/Magento/Downloadable/Model/Resource/Link.php @@ -35,16 +35,14 @@ class Link extends \Magento\Framework\Model\Resource\Db\AbstractDb protected $_storeManager; /** - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Framework\App\Config\ScopeConfigInterface $configuration * @param \Magento\Directory\Model\CurrencyFactory $currencyFactory * @param \Magento\Framework\Store\StoreManagerInterface $storeManager */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, \Magento\Catalog\Helper\Data $catalogData, \Magento\Framework\App\Config\ScopeConfigInterface $configuration, \Magento\Directory\Model\CurrencyFactory $currencyFactory, @@ -54,7 +52,7 @@ public function __construct( $this->_configuration = $configuration; $this->_currencyFactory = $currencyFactory; $this->_storeManager = $storeManager; - parent::__construct($resource, $transactionManager); + parent::__construct($context); } /** diff --git a/app/code/Magento/Eav/Model/Resource/Entity/Attribute.php b/app/code/Magento/Eav/Model/Resource/Entity/Attribute.php index 31c60d0385ff5..36201352bb01e 100644 --- a/app/code/Magento/Eav/Model/Resource/Entity/Attribute.php +++ b/app/code/Magento/Eav/Model/Resource/Entity/Attribute.php @@ -37,20 +37,18 @@ class Attribute extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * Class constructor * - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param \Magento\Framework\Store\StoreManagerInterface $storeManager * @param Type $eavEntityType */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, \Magento\Framework\Store\StoreManagerInterface $storeManager, Type $eavEntityType ) { $this->_storeManager = $storeManager; $this->_eavEntityType = $eavEntityType; - parent::__construct($resource, $transactionManager); + parent::__construct($context); } /** diff --git a/app/code/Magento/Eav/Model/Resource/Entity/Attribute/Set.php b/app/code/Magento/Eav/Model/Resource/Entity/Attribute/Set.php index 01840fcc69c7f..1326a99fe9fc8 100644 --- a/app/code/Magento/Eav/Model/Resource/Entity/Attribute/Set.php +++ b/app/code/Magento/Eav/Model/Resource/Entity/Attribute/Set.php @@ -23,18 +23,16 @@ class Set extends \Magento\Framework\Model\Resource\Db\AbstractDb protected $eavConfig; /** - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param GroupFactory $attrGroupFactory * @param \Magento\Eav\Model\Config $eavConfig */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, \Magento\Eav\Model\Resource\Entity\Attribute\GroupFactory $attrGroupFactory, \Magento\Eav\Model\Config $eavConfig ) { - parent::__construct($resource, $transactionManager); + parent::__construct($context); $this->_attrGroupFactory = $attrGroupFactory; $this->eavConfig = $eavConfig; } diff --git a/app/code/Magento/Email/Model/Resource/Template.php b/app/code/Magento/Email/Model/Resource/Template.php index 6d779eb6b3cf8..3ee95788d551c 100644 --- a/app/code/Magento/Email/Model/Resource/Template.php +++ b/app/code/Magento/Email/Model/Resource/Template.php @@ -20,17 +20,15 @@ class Template extends \Magento\Framework\Model\Resource\Db\AbstractDb protected $dateTime; /** - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param \Magento\Framework\Stdlib\DateTime $dateTime */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, \Magento\Framework\Stdlib\DateTime $dateTime ) { $this->dateTime = $dateTime; - parent::__construct($resource, $transactionManager); + parent::__construct($context); } /** diff --git a/app/code/Magento/ImportExport/Model/Resource/Import/Data.php b/app/code/Magento/ImportExport/Model/Resource/Import/Data.php index 9fd2254b28c2a..e82104ccc2756 100644 --- a/app/code/Magento/ImportExport/Model/Resource/Import/Data.php +++ b/app/code/Magento/ImportExport/Model/Resource/Import/Data.php @@ -27,18 +27,16 @@ class Data extends \Magento\Framework\Model\Resource\Db\AbstractDb implements \I /** * Class constructor * - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param \Magento\Core\Helper\Data $coreHelper * @param array $arguments */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, \Magento\Core\Helper\Data $coreHelper, array $arguments = [] ) { - parent::__construct($resource, $transactionManager); + parent::__construct($context); $this->_jsonHelper = $coreHelper; } diff --git a/app/code/Magento/Integration/Model/Resource/Oauth/Consumer.php b/app/code/Magento/Integration/Model/Resource/Oauth/Consumer.php index 959b57c5afadc..72c670514c9b4 100644 --- a/app/code/Magento/Integration/Model/Resource/Oauth/Consumer.php +++ b/app/code/Magento/Integration/Model/Resource/Oauth/Consumer.php @@ -13,17 +13,15 @@ class Consumer extends \Magento\Framework\Model\Resource\Db\AbstractDb protected $_dateTime; /** - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param \Magento\Framework\Stdlib\DateTime $dateTime */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, \Magento\Framework\Stdlib\DateTime $dateTime ) { $this->_dateTime = $dateTime; - parent::__construct($resource, $transactionManager); + parent::__construct($context); } /** diff --git a/app/code/Magento/Integration/Model/Resource/Oauth/Token.php b/app/code/Magento/Integration/Model/Resource/Oauth/Token.php index 9274429f76f75..daa9da6790667 100644 --- a/app/code/Magento/Integration/Model/Resource/Oauth/Token.php +++ b/app/code/Magento/Integration/Model/Resource/Oauth/Token.php @@ -18,17 +18,15 @@ class Token extends \Magento\Framework\Model\Resource\Db\AbstractDb protected $_dateTime; /** - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param \Magento\Framework\Stdlib\DateTime $dateTime */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, \Magento\Framework\Stdlib\DateTime $dateTime ) { $this->_dateTime = $dateTime; - parent::__construct($resource, $transactionManager); + parent::__construct($context); } /** diff --git a/app/code/Magento/Log/Model/Resource/Log.php b/app/code/Magento/Log/Model/Resource/Log.php index ca14630693250..f8c550a929206 100644 --- a/app/code/Magento/Log/Model/Resource/Log.php +++ b/app/code/Magento/Log/Model/Resource/Log.php @@ -30,15 +30,13 @@ class Log extends \Magento\Framework\Model\Resource\Db\AbstractDb protected $dateTime; /** - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param \Magento\Framework\Stdlib\DateTime\DateTime $date * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Framework\Stdlib\DateTime $dateTime */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, \Magento\Framework\Stdlib\DateTime\DateTime $date, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Framework\Stdlib\DateTime $dateTime @@ -46,7 +44,7 @@ public function __construct( $this->_date = $date; $this->_eventManager = $eventManager; $this->dateTime = $dateTime; - parent::__construct($resource, $transactionManager); + parent::__construct($context); } /** diff --git a/app/code/Magento/Log/Model/Resource/Visitor.php b/app/code/Magento/Log/Model/Resource/Visitor.php index 313e884a9ea7a..c798d2a3695f5 100644 --- a/app/code/Magento/Log/Model/Resource/Visitor.php +++ b/app/code/Magento/Log/Model/Resource/Visitor.php @@ -35,15 +35,13 @@ class Visitor extends \Magento\Framework\Model\Resource\Db\AbstractDb protected $_storeManager; /** - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param \Magento\Framework\Stdlib\DateTime\DateTime $date * @param \Magento\Framework\Store\StoreManagerInterface $storeManager * @param \Magento\Framework\Stdlib\String $string */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, \Magento\Framework\Stdlib\DateTime\DateTime $date, \Magento\Framework\Store\StoreManagerInterface $storeManager, \Magento\Framework\Stdlib\String $string @@ -51,7 +49,7 @@ public function __construct( $this->_date = $date; $this->_storeManager = $storeManager; $this->string = $string; - parent::__construct($resource, $transactionManager); + parent::__construct($context); } /** diff --git a/app/code/Magento/Log/Model/Resource/Visitor/Online.php b/app/code/Magento/Log/Model/Resource/Visitor/Online.php index e319420e7df28..d0dfcf5c4de59 100644 --- a/app/code/Magento/Log/Model/Resource/Visitor/Online.php +++ b/app/code/Magento/Log/Model/Resource/Visitor/Online.php @@ -21,17 +21,15 @@ class Online extends \Magento\Framework\Model\Resource\Db\AbstractDb protected $_date; /** - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param \Magento\Framework\Stdlib\DateTime\DateTime $date */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, \Magento\Framework\Stdlib\DateTime\DateTime $date ) { $this->_date = $date; - parent::__construct($resource, $transactionManager); + parent::__construct($context); } /** diff --git a/app/code/Magento/Newsletter/Model/Resource/Queue.php b/app/code/Magento/Newsletter/Model/Resource/Queue.php index 7c82262ad8e50..2bbfefbec2d9d 100644 --- a/app/code/Magento/Newsletter/Model/Resource/Queue.php +++ b/app/code/Magento/Newsletter/Model/Resource/Queue.php @@ -25,16 +25,14 @@ class Queue extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * Construct * - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param \Magento\Newsletter\Model\Resource\Subscriber\Collection $subscriberCollection */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, \Magento\Newsletter\Model\Resource\Subscriber\Collection $subscriberCollection ) { - parent::__construct($resource, $transactionManager); + parent::__construct($context); $this->_subscriberCollection = $subscriberCollection; } diff --git a/app/code/Magento/Newsletter/Model/Resource/Subscriber.php b/app/code/Magento/Newsletter/Model/Resource/Subscriber.php index b79058bf2261f..36af6f3409195 100644 --- a/app/code/Magento/Newsletter/Model/Resource/Subscriber.php +++ b/app/code/Magento/Newsletter/Model/Resource/Subscriber.php @@ -55,20 +55,18 @@ class Subscriber extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * Construct * - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param \Magento\Framework\Stdlib\DateTime\DateTime $date * @param \Magento\Framework\Math\Random $mathRandom */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, \Magento\Framework\Stdlib\DateTime\DateTime $date, \Magento\Framework\Math\Random $mathRandom ) { $this->_date = $date; $this->mathRandom = $mathRandom; - parent::__construct($resource, $transactionManager); + parent::__construct($context); } /** diff --git a/app/code/Magento/Newsletter/Model/Resource/Template.php b/app/code/Magento/Newsletter/Model/Resource/Template.php index a831e95d7829a..99c900722da8b 100644 --- a/app/code/Magento/Newsletter/Model/Resource/Template.php +++ b/app/code/Magento/Newsletter/Model/Resource/Template.php @@ -23,16 +23,14 @@ class Template extends \Magento\Framework\Model\Resource\Db\AbstractDb protected $_date; /** - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param \Magento\Framework\Stdlib\DateTime\DateTime $date */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, \Magento\Framework\Stdlib\DateTime\DateTime $date ) { - parent::__construct($resource, $transactionManager); + parent::__construct($context); $this->_date = $date; } diff --git a/app/code/Magento/OfflineShipping/Model/Resource/Carrier/Tablerate.php b/app/code/Magento/OfflineShipping/Model/Resource/Carrier/Tablerate.php index 60d12b7245b94..2f79d358101f2 100644 --- a/app/code/Magento/OfflineShipping/Model/Resource/Carrier/Tablerate.php +++ b/app/code/Magento/OfflineShipping/Model/Resource/Carrier/Tablerate.php @@ -122,8 +122,7 @@ class Tablerate extends \Magento\Framework\Model\Resource\Db\AbstractDb protected $_filesystem; /** - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\App\Config\ScopeConfigInterface $coreConfig * @param \Magento\Framework\Store\StoreManagerInterface $storeManager @@ -133,8 +132,7 @@ class Tablerate extends \Magento\Framework\Model\Resource\Db\AbstractDb * @param \Magento\Framework\Filesystem $filesystem */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, \Psr\Log\LoggerInterface $logger, \Magento\Framework\App\Config\ScopeConfigInterface $coreConfig, \Magento\Framework\Store\StoreManagerInterface $storeManager, @@ -143,7 +141,7 @@ public function __construct( \Magento\Directory\Model\Resource\Region\CollectionFactory $regionCollectionFactory, \Magento\Framework\Filesystem $filesystem ) { - parent::__construct($resource, $transactionManager); + parent::__construct($context); $this->_coreConfig = $coreConfig; $this->_logger = $logger; $this->_storeManager = $storeManager; diff --git a/app/code/Magento/Persistent/Model/Resource/Session.php b/app/code/Magento/Persistent/Model/Resource/Session.php index 68c9f1e873f34..51d4058da53ec 100644 --- a/app/code/Magento/Persistent/Model/Resource/Session.php +++ b/app/code/Magento/Persistent/Model/Resource/Session.php @@ -27,17 +27,15 @@ class Session extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * Class constructor * - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param \Magento\Persistent\Model\SessionFactory $sessionFactory */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, \Magento\Persistent\Model\SessionFactory $sessionFactory ) { $this->_sessionFactory = $sessionFactory; - parent::__construct($resource, $transactionManager); + parent::__construct($context); } /** diff --git a/app/code/Magento/ProductAlert/Model/Resource/Price.php b/app/code/Magento/ProductAlert/Model/Resource/Price.php index 818ac0b9189b7..b8c92ad3869d3 100644 --- a/app/code/Magento/ProductAlert/Model/Resource/Price.php +++ b/app/code/Magento/ProductAlert/Model/Resource/Price.php @@ -19,17 +19,15 @@ class Price extends \Magento\ProductAlert\Model\Resource\AbstractResource protected $_dateFactory; /** - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param \Magento\Framework\Stdlib\DateTime\DateTimeFactory $dateFactory */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, \Magento\Framework\Stdlib\DateTime\DateTimeFactory $dateFactory ) { $this->_dateFactory = $dateFactory; - parent::__construct($resource, $transactionManager); + parent::__construct($context); } /** diff --git a/app/code/Magento/ProductAlert/Model/Resource/Stock.php b/app/code/Magento/ProductAlert/Model/Resource/Stock.php index 11f09b6f5ca99..ab980a519592d 100644 --- a/app/code/Magento/ProductAlert/Model/Resource/Stock.php +++ b/app/code/Magento/ProductAlert/Model/Resource/Stock.php @@ -19,17 +19,15 @@ class Stock extends \Magento\ProductAlert\Model\Resource\AbstractResource protected $_dateFactory; /** - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param \Magento\Framework\Stdlib\DateTime\DateTimeFactory $dateFactory */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, \Magento\Framework\Stdlib\DateTime\DateTimeFactory $dateFactory ) { $this->_dateFactory = $dateFactory; - parent::__construct($resource, $transactionManager); + parent::__construct($context); } /** diff --git a/app/code/Magento/Quote/Model/Resource/Quote.php b/app/code/Magento/Quote/Model/Resource/Quote.php index 7d9b502c5e753..d833255608c9e 100644 --- a/app/code/Magento/Quote/Model/Resource/Quote.php +++ b/app/code/Magento/Quote/Model/Resource/Quote.php @@ -21,16 +21,14 @@ class Quote extends AbstractDb protected $_config; /** - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param \Magento\Eav\Model\Config $config */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, \Magento\Eav\Model\Config $config ) { - parent::__construct($resource, $transactionManager); + parent::__construct($context); $this->_config = $config; } diff --git a/app/code/Magento/Reports/Model/Resource/Event.php b/app/code/Magento/Reports/Model/Resource/Event.php index 2698dd488708d..7524e31370b34 100644 --- a/app/code/Magento/Reports/Model/Resource/Event.php +++ b/app/code/Magento/Reports/Model/Resource/Event.php @@ -23,18 +23,16 @@ class Event extends \Magento\Framework\Model\Resource\Db\AbstractDb protected $_storeManager; /** - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Framework\Store\StoreManagerInterface $storeManager */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Framework\Store\StoreManagerInterface $storeManager ) { - parent::__construct($resource, $transactionManager); + parent::__construct($context); $this->_scopeConfig = $scopeConfig; $this->_storeManager = $storeManager; } diff --git a/app/code/Magento/Reports/Model/Resource/Product/Index/AbstractIndex.php b/app/code/Magento/Reports/Model/Resource/Product/Index/AbstractIndex.php index 36b8d13097ee9..ada85464dbded 100644 --- a/app/code/Magento/Reports/Model/Resource/Product/Index/AbstractIndex.php +++ b/app/code/Magento/Reports/Model/Resource/Product/Index/AbstractIndex.php @@ -24,18 +24,16 @@ abstract class AbstractIndex extends \Magento\Framework\Model\Resource\Db\Abstra protected $_resourceHelper; /** - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param \Magento\Reports\Model\Resource\Helper $resourceHelper * @param \Magento\Framework\Stdlib\DateTime $dateTime */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, \Magento\Reports\Model\Resource\Helper $resourceHelper, \Magento\Framework\Stdlib\DateTime $dateTime ) { - parent::__construct($resource, $transactionManager); + parent::__construct($context); $this->_resourceHelper = $resourceHelper; $this->dateTime = $dateTime; } diff --git a/app/code/Magento/Reports/Model/Resource/Report/AbstractReport.php b/app/code/Magento/Reports/Model/Resource/Report/AbstractReport.php index 7d1ba3291e3c2..8a8fd3f68918d 100644 --- a/app/code/Magento/Reports/Model/Resource/Report/AbstractReport.php +++ b/app/code/Magento/Reports/Model/Resource/Report/AbstractReport.php @@ -37,8 +37,7 @@ abstract class AbstractReport extends \Magento\Framework\Model\Resource\Db\Abstr protected $_reportsFlagFactory; /** - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate * @param \Magento\Reports\Model\FlagFactory $reportsFlagFactory @@ -46,15 +45,14 @@ abstract class AbstractReport extends \Magento\Framework\Model\Resource\Db\Abstr * @param \Magento\Framework\Stdlib\DateTime\Timezone\Validator $timezoneValidator */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, \Psr\Log\LoggerInterface $logger, \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate, \Magento\Reports\Model\FlagFactory $reportsFlagFactory, \Magento\Framework\Stdlib\DateTime $dateTime, \Magento\Framework\Stdlib\DateTime\Timezone\Validator $timezoneValidator ) { - parent::__construct($resource, $transactionManager); + parent::__construct($context); $this->_logger = $logger; $this->_localeDate = $localeDate; $this->_reportsFlagFactory = $reportsFlagFactory; diff --git a/app/code/Magento/Reports/Model/Resource/Report/Product/Viewed.php b/app/code/Magento/Reports/Model/Resource/Report/Product/Viewed.php index c164f637085ac..677dda2855be0 100644 --- a/app/code/Magento/Reports/Model/Resource/Report/Product/Viewed.php +++ b/app/code/Magento/Reports/Model/Resource/Report/Product/Viewed.php @@ -41,8 +41,7 @@ class Viewed extends \Magento\Sales\Model\Resource\Report\AbstractReport protected $_resourceHelper; /** - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate * @param \Magento\Reports\Model\FlagFactory $reportsFlagFactory @@ -52,8 +51,7 @@ class Viewed extends \Magento\Sales\Model\Resource\Report\AbstractReport * @param \Magento\Reports\Model\Resource\Helper $resourceHelper */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, \Psr\Log\LoggerInterface $logger, \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate, \Magento\Reports\Model\FlagFactory $reportsFlagFactory, @@ -63,8 +61,7 @@ public function __construct( \Magento\Reports\Model\Resource\Helper $resourceHelper ) { parent::__construct( - $resource, - $transactionManager, + $context, $logger, $localeDate, $reportsFlagFactory, diff --git a/app/code/Magento/Review/Model/Resource/Rating.php b/app/code/Magento/Review/Model/Resource/Rating.php index ce74e87665008..703bdc0840907 100644 --- a/app/code/Magento/Review/Model/Resource/Rating.php +++ b/app/code/Magento/Review/Model/Resource/Rating.php @@ -32,16 +32,14 @@ class Rating extends \Magento\Framework\Model\Resource\Db\AbstractDb protected $_logger; /** - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Module\Manager $moduleManager * @param \Magento\Framework\Store\StoreManagerInterface $storeManager * @param \Magento\Review\Model\Resource\Review\Summary $reviewSummary */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, \Psr\Log\LoggerInterface $logger, \Magento\Framework\Module\Manager $moduleManager, \Magento\Framework\Store\StoreManagerInterface $storeManager, @@ -51,7 +49,7 @@ public function __construct( $this->_storeManager = $storeManager; $this->_logger = $logger; $this->_reviewSummary = $reviewSummary; - parent::__construct($resource, $transactionManager); + parent::__construct($context); } /** diff --git a/app/code/Magento/Review/Model/Resource/Rating/Option.php b/app/code/Magento/Review/Model/Resource/Rating/Option.php index a842b3820f35d..124024b9d5b03 100644 --- a/app/code/Magento/Review/Model/Resource/Rating/Option.php +++ b/app/code/Magento/Review/Model/Resource/Rating/Option.php @@ -79,15 +79,13 @@ class Option extends \Magento\Framework\Model\Resource\Db\AbstractDb protected $_ratingOptionVoteF; /** - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Review\Model\Rating\Option\VoteFactory $ratingOptionVoteF * @param \Magento\Framework\HTTP\PhpEnvironment\RemoteAddress $remoteAddress */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, \Magento\Customer\Model\Session $customerSession, \Magento\Review\Model\Rating\Option\VoteFactory $ratingOptionVoteF, \Magento\Framework\HTTP\PhpEnvironment\RemoteAddress $remoteAddress @@ -95,7 +93,7 @@ public function __construct( $this->_customerSession = $customerSession; $this->_ratingOptionVoteF = $ratingOptionVoteF; $this->_remoteAddress = $remoteAddress; - parent::__construct($resource, $transactionManager); + parent::__construct($context); } /** diff --git a/app/code/Magento/Review/Model/Resource/Review.php b/app/code/Magento/Review/Model/Resource/Review.php index a4e683b3cdf54..378ab674b08fa 100644 --- a/app/code/Magento/Review/Model/Resource/Review.php +++ b/app/code/Magento/Review/Model/Resource/Review.php @@ -90,16 +90,14 @@ class Review extends \Magento\Framework\Model\Resource\Db\AbstractDb protected $_ratingOptions; /** - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param \Magento\Framework\Stdlib\DateTime\DateTime $date * @param \Magento\Framework\Store\StoreManagerInterface $storeManager * @param \Magento\Review\Model\RatingFactory $ratingFactory * @param \Magento\Review\Model\Resource\Rating\Option $ratingOptions */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, \Magento\Framework\Stdlib\DateTime\DateTime $date, \Magento\Framework\Store\StoreManagerInterface $storeManager, \Magento\Review\Model\RatingFactory $ratingFactory, @@ -110,7 +108,7 @@ public function __construct( $this->_ratingFactory = $ratingFactory; $this->_ratingOptions = $ratingOptions; - parent::__construct($resource, $transactionManager); + parent::__construct($context); } /** diff --git a/app/code/Magento/Sales/Model/Resource/AbstractGrid.php b/app/code/Magento/Sales/Model/Resource/AbstractGrid.php index 6ca4d7fdfcf25..c0d307250dc24 100644 --- a/app/code/Magento/Sales/Model/Resource/AbstractGrid.php +++ b/app/code/Magento/Sales/Model/Resource/AbstractGrid.php @@ -34,18 +34,7 @@ abstract class AbstractGrid extends AbstractDb implements GridInterface */ protected $addressTableName = 'sales_order_address'; - /** - * @param AppResource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager - */ - public function __construct( - AppResource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager - ) { - parent::__construct($resource, $transactionManager); - } - - /** + /** * Resource initialization * * @return void diff --git a/app/code/Magento/Sales/Model/Resource/Entity.php b/app/code/Magento/Sales/Model/Resource/Entity.php index de16c6f20326c..68f00818e9f5b 100644 --- a/app/code/Magento/Sales/Model/Resource/Entity.php +++ b/app/code/Magento/Sales/Model/Resource/Entity.php @@ -56,15 +56,13 @@ abstract class Entity extends AbstractDb protected $gridAggregator; /** - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param Attribute $attribute * @param \Magento\Sales\Model\Increment $salesIncrement * @param GridInterface|null $gridAggregator */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, \Magento\Sales\Model\Resource\Attribute $attribute, \Magento\Sales\Model\Increment $salesIncrement, \Magento\Sales\Model\Resource\GridInterface $gridAggregator = null @@ -72,7 +70,7 @@ public function __construct( $this->attribute = $attribute; $this->salesIncrement = $salesIncrement; $this->gridAggregator = $gridAggregator; - parent::__construct($resource, $transactionManager); + parent::__construct($context); } /** diff --git a/app/code/Magento/Sales/Model/Resource/Order.php b/app/code/Magento/Sales/Model/Resource/Order.php index 0bc4e34683f68..6a84a9cd1d7e5 100644 --- a/app/code/Magento/Sales/Model/Resource/Order.php +++ b/app/code/Magento/Sales/Model/Resource/Order.php @@ -56,8 +56,7 @@ protected function _construct() } /** - * @param AppResource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param Attribute $attribute * @param SalesIncrement $salesIncrement * @param AddressHandler $addressHandler @@ -65,8 +64,7 @@ protected function _construct() * @param OrderGrid $gridAggregator */ public function __construct( - AppResource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, Attribute $attribute, SalesIncrement $salesIncrement, AddressHandler $addressHandler, @@ -75,7 +73,7 @@ public function __construct( ) { $this->stateHandler = $stateHandler; $this->addressHandler = $addressHandler; - parent::__construct($resource, $transactionManager, $attribute, $salesIncrement, $gridAggregator); + parent::__construct($context, $attribute, $salesIncrement, $gridAggregator); } /** diff --git a/app/code/Magento/Sales/Model/Resource/Order/Address.php b/app/code/Magento/Sales/Model/Resource/Order/Address.php index 67d44fdee196b..213bce6367833 100644 --- a/app/code/Magento/Sales/Model/Resource/Order/Address.php +++ b/app/code/Magento/Sales/Model/Resource/Order/Address.php @@ -31,8 +31,7 @@ class Address extends SalesResource implements OrderAddressResourceInterface protected $gridPool; /** - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param \Magento\Sales\Model\Resource\Attribute $attribute * @param \Magento\Sales\Model\Increment $salesIncrement * @param \Magento\Sales\Model\Order\Address\Validator $validator @@ -40,8 +39,7 @@ class Address extends SalesResource implements OrderAddressResourceInterface * @param \Magento\Sales\Model\Resource\GridInterface $gridAggregator */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, \Magento\Sales\Model\Resource\Attribute $attribute, \Magento\Sales\Model\Increment $salesIncrement, \Magento\Sales\Model\Order\Address\Validator $validator, @@ -50,7 +48,7 @@ public function __construct( ) { $this->_validator = $validator; $this->gridPool = $gridPool; - parent::__construct($resource, $transactionManager, $attribute, $salesIncrement, $gridAggregator); + parent::__construct($context, $attribute, $salesIncrement, $gridAggregator); } /** diff --git a/app/code/Magento/Sales/Model/Resource/Order/Creditmemo.php b/app/code/Magento/Sales/Model/Resource/Order/Creditmemo.php index 42d32779ea580..6d76443f86caf 100644 --- a/app/code/Magento/Sales/Model/Resource/Order/Creditmemo.php +++ b/app/code/Magento/Sales/Model/Resource/Order/Creditmemo.php @@ -39,20 +39,18 @@ protected function _construct() /** * Constructor * - * @param AppResource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param Attribute $attribute * @param SalesIncrement $salesIncrement * @param CreditmemoGrid $gridAggregator */ public function __construct( - AppResource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, Attribute $attribute, SalesIncrement $salesIncrement, CreditmemoGrid $gridAggregator ) { - parent::__construct($resource, $transactionManager, $attribute, $salesIncrement, $gridAggregator); + parent::__construct($context, $attribute, $salesIncrement, $gridAggregator); } /** diff --git a/app/code/Magento/Sales/Model/Resource/Order/Creditmemo/Comment.php b/app/code/Magento/Sales/Model/Resource/Order/Creditmemo/Comment.php index 09b58d17c4939..ae17fdf369a54 100644 --- a/app/code/Magento/Sales/Model/Resource/Order/Creditmemo/Comment.php +++ b/app/code/Magento/Sales/Model/Resource/Order/Creditmemo/Comment.php @@ -30,23 +30,21 @@ class Comment extends Entity implements CreditmemoCommentResourceInterface protected $validator; /** - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param \Magento\Sales\Model\Resource\Attribute $attribute * @param \Magento\Sales\Model\Increment $salesIncrement * @param \Magento\Sales\Model\Order\Creditmemo\Comment\Validator $validator * @param \Magento\Sales\Model\Resource\GridInterface $gridAggregator */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, \Magento\Sales\Model\Resource\Attribute $attribute, \Magento\Sales\Model\Increment $salesIncrement, \Magento\Sales\Model\Order\Creditmemo\Comment\Validator $validator, \Magento\Sales\Model\Resource\GridInterface $gridAggregator = null ) { $this->validator = $validator; - parent::__construct($resource, $transactionManager, $attribute, $salesIncrement, $gridAggregator); + parent::__construct($context, $attribute, $salesIncrement, $gridAggregator); } /** diff --git a/app/code/Magento/Sales/Model/Resource/Order/Invoice.php b/app/code/Magento/Sales/Model/Resource/Order/Invoice.php index 7e92d2bd2176a..a3bc43fe1e418 100644 --- a/app/code/Magento/Sales/Model/Resource/Order/Invoice.php +++ b/app/code/Magento/Sales/Model/Resource/Order/Invoice.php @@ -35,20 +35,18 @@ protected function _construct() } /** - * @param Resource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param Attribute $attribute * @param SalesIncrement $salesIncrement * @param InvoiceGrid $gridAggregator */ public function __construct( - Resource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, Attribute $attribute, SalesIncrement $salesIncrement, InvoiceGrid $gridAggregator ) { - parent::__construct($resource, $transactionManager, $attribute, $salesIncrement, $gridAggregator); + parent::__construct($context, $attribute, $salesIncrement, $gridAggregator); } /** diff --git a/app/code/Magento/Sales/Model/Resource/Order/Invoice/Comment.php b/app/code/Magento/Sales/Model/Resource/Order/Invoice/Comment.php index c8cd4862a843d..d13c55921d09c 100644 --- a/app/code/Magento/Sales/Model/Resource/Order/Invoice/Comment.php +++ b/app/code/Magento/Sales/Model/Resource/Order/Invoice/Comment.php @@ -30,23 +30,21 @@ class Comment extends Entity implements InvoiceCommentResourceInterface protected $validator; /** - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param \Magento\Sales\Model\Resource\Attribute $attribute * @param \Magento\Sales\Model\Increment $salesIncrement * @param \Magento\Sales\Model\Order\Invoice\Comment\Validator $validator * @param \Magento\Sales\Model\Resource\GridInterface $gridAggregator */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, \Magento\Sales\Model\Resource\Attribute $attribute, \Magento\Sales\Model\Increment $salesIncrement, \Magento\Sales\Model\Order\Invoice\Comment\Validator $validator, \Magento\Sales\Model\Resource\GridInterface $gridAggregator = null ) { $this->validator = $validator; - parent::__construct($resource, $transactionManager, $attribute, $salesIncrement, $gridAggregator); + parent::__construct($context, $attribute, $salesIncrement, $gridAggregator); } /** diff --git a/app/code/Magento/Sales/Model/Resource/Order/Shipment.php b/app/code/Magento/Sales/Model/Resource/Order/Shipment.php index b969e852c9b09..e5721643a7046 100644 --- a/app/code/Magento/Sales/Model/Resource/Order/Shipment.php +++ b/app/code/Magento/Sales/Model/Resource/Order/Shipment.php @@ -44,20 +44,18 @@ protected function _construct() } /** - * @param AppResource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param Attribute $attribute * @param SalesIncrement $salesIncrement * @param ShipmentGrid $gridAggregator */ public function __construct( - AppResource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, Attribute $attribute, SalesIncrement $salesIncrement, ShipmentGrid $gridAggregator ) { - parent::__construct($resource, $transactionManager, $attribute, $salesIncrement, $gridAggregator); + parent::__construct($context, $attribute, $salesIncrement, $gridAggregator); } /** diff --git a/app/code/Magento/Sales/Model/Resource/Order/Shipment/Comment.php b/app/code/Magento/Sales/Model/Resource/Order/Shipment/Comment.php index eba0aceba94c2..e46396a5bf893 100644 --- a/app/code/Magento/Sales/Model/Resource/Order/Shipment/Comment.php +++ b/app/code/Magento/Sales/Model/Resource/Order/Shipment/Comment.php @@ -30,23 +30,21 @@ class Comment extends Entity implements ShipmentCommentResourceInterface protected $validator; /** - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param \Magento\Sales\Model\Resource\Attribute $attribute * @param \Magento\Sales\Model\Increment $salesIncrement * @param \Magento\Sales\Model\Order\Shipment\Comment\Validator $validator * @param \Magento\Sales\Model\Resource\GridInterface $gridAggregator */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, \Magento\Sales\Model\Resource\Attribute $attribute, \Magento\Sales\Model\Increment $salesIncrement, \Magento\Sales\Model\Order\Shipment\Comment\Validator $validator, \Magento\Sales\Model\Resource\GridInterface $gridAggregator = null ) { $this->validator = $validator; - parent::__construct($resource, $transactionManager, $attribute, $salesIncrement, $gridAggregator); + parent::__construct($context, $attribute, $salesIncrement, $gridAggregator); } /** diff --git a/app/code/Magento/Sales/Model/Resource/Order/Shipment/Track.php b/app/code/Magento/Sales/Model/Resource/Order/Shipment/Track.php index c39bfa3f5bb04..068084f045a8d 100644 --- a/app/code/Magento/Sales/Model/Resource/Order/Shipment/Track.php +++ b/app/code/Magento/Sales/Model/Resource/Order/Shipment/Track.php @@ -30,23 +30,21 @@ class Track extends SalesResource implements ShipmentTrackResourceInterface protected $validator; /** - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param \Magento\Sales\Model\Resource\Attribute $attribute * @param \Magento\Sales\Model\Increment $salesIncrement * @param \Magento\Sales\Model\Order\Shipment\Track\Validator $validator * @param \Magento\Sales\Model\Resource\GridInterface $gridAggregator */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, \Magento\Sales\Model\Resource\Attribute $attribute, \Magento\Sales\Model\Increment $salesIncrement, \Magento\Sales\Model\Order\Shipment\Track\Validator $validator, \Magento\Sales\Model\Resource\GridInterface $gridAggregator = null ) { $this->validator = $validator; - parent::__construct($resource, $transactionManager, $attribute, $salesIncrement, $gridAggregator); + parent::__construct($context, $attribute, $salesIncrement, $gridAggregator); } /** diff --git a/app/code/Magento/Sales/Model/Resource/Order/Status.php b/app/code/Magento/Sales/Model/Resource/Order/Status.php index 5578c5cae5377..f38a50abaef0e 100644 --- a/app/code/Magento/Sales/Model/Resource/Order/Status.php +++ b/app/code/Magento/Sales/Model/Resource/Order/Status.php @@ -38,17 +38,15 @@ class Status extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * Class constructor * - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param LogWriter $logger */ public function __construct( - Resource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, LogWriter $logger ) { $this->logger = $logger; - parent::__construct($resource, $transactionManager); + parent::__construct($context); } /** diff --git a/app/code/Magento/Sales/Model/Resource/Order/Status/History.php b/app/code/Magento/Sales/Model/Resource/Order/Status/History.php index 5ecca04a54948..c9bb299ad7fac 100644 --- a/app/code/Magento/Sales/Model/Resource/Order/Status/History.php +++ b/app/code/Magento/Sales/Model/Resource/Order/Status/History.php @@ -22,8 +22,7 @@ class History extends Entity implements OrderStatusHistoryResourceInterface protected $validator; /** - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param \Magento\Framework\Stdlib\DateTime $dateTime * @param \Magento\Sales\Model\Resource\Attribute $attribute * @param \Magento\Sales\Model\Increment $salesIncrement @@ -31,15 +30,14 @@ class History extends Entity implements OrderStatusHistoryResourceInterface * @param \Magento\Sales\Model\Resource\GridInterface $gridAggregator */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, \Magento\Sales\Model\Resource\Attribute $attribute, \Magento\Sales\Model\Increment $salesIncrement, Validator $validator, \Magento\Sales\Model\Resource\GridInterface $gridAggregator = null ) { $this->validator = $validator; - parent::__construct($resource, $transactionManager, $attribute, $salesIncrement, $gridAggregator); + parent::__construct($context, $attribute, $salesIncrement, $gridAggregator); } /** diff --git a/app/code/Magento/Sales/Model/Resource/Report/Bestsellers.php b/app/code/Magento/Sales/Model/Resource/Report/Bestsellers.php index 5078a5aa4170c..26e949ff3feb0 100644 --- a/app/code/Magento/Sales/Model/Resource/Report/Bestsellers.php +++ b/app/code/Magento/Sales/Model/Resource/Report/Bestsellers.php @@ -37,8 +37,7 @@ class Bestsellers extends AbstractReport ]; /** - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate * @param \Magento\Reports\Model\FlagFactory $reportsFlagFactory @@ -49,8 +48,7 @@ class Bestsellers extends AbstractReport * @param array $ignoredProductTypes */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, \Psr\Log\LoggerInterface $logger, \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate, \Magento\Reports\Model\FlagFactory $reportsFlagFactory, @@ -61,8 +59,7 @@ public function __construct( array $ignoredProductTypes = [] ) { parent::__construct( - $resource, - $transactionManager, + $context, $logger, $localeDate, $reportsFlagFactory, diff --git a/app/code/Magento/Sales/Model/Resource/Report/Order.php b/app/code/Magento/Sales/Model/Resource/Report/Order.php index bc8fbe99dfed9..8d7006a362284 100644 --- a/app/code/Magento/Sales/Model/Resource/Report/Order.php +++ b/app/code/Magento/Sales/Model/Resource/Report/Order.php @@ -21,8 +21,7 @@ class Order extends AbstractReport protected $_updateDatFactory; /** - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate * @param \Magento\Reports\Model\FlagFactory $reportsFlagFactory @@ -32,8 +31,7 @@ class Order extends AbstractReport * @param \Magento\Sales\Model\Resource\Report\Order\UpdatedatFactory $updateDatFactory */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, \Psr\Log\LoggerInterface $logger, \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate, \Magento\Reports\Model\FlagFactory $reportsFlagFactory, @@ -43,8 +41,7 @@ public function __construct( \Magento\Sales\Model\Resource\Report\Order\UpdatedatFactory $updateDatFactory ) { parent::__construct( - $resource, - $transactionManager, + $context, $logger, $localeDate, $reportsFlagFactory, diff --git a/app/code/Magento/SalesRule/Model/Resource/Report/Rule.php b/app/code/Magento/SalesRule/Model/Resource/Report/Rule.php index e0fe6d7eac373..70401c9879858 100644 --- a/app/code/Magento/SalesRule/Model/Resource/Report/Rule.php +++ b/app/code/Magento/SalesRule/Model/Resource/Report/Rule.php @@ -23,8 +23,7 @@ class Rule extends \Magento\Reports\Model\Resource\Report\AbstractReport protected $_updatedatFactory; /** - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate * @param \Magento\Reports\Model\FlagFactory $reportsFlagFactory @@ -34,8 +33,7 @@ class Rule extends \Magento\Reports\Model\Resource\Report\AbstractReport * @param \Magento\SalesRule\Model\Resource\Report\Rule\UpdatedatFactory $updatedatFactory */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, \Psr\Log\LoggerInterface $logger, \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate, \Magento\Reports\Model\FlagFactory $reportsFlagFactory, @@ -45,8 +43,7 @@ public function __construct( \Magento\SalesRule\Model\Resource\Report\Rule\UpdatedatFactory $updatedatFactory ) { parent::__construct( - $resource, - $transactionManager, + $context, $logger, $localeDate, $reportsFlagFactory, diff --git a/app/code/Magento/SalesRule/Model/Resource/Rule.php b/app/code/Magento/SalesRule/Model/Resource/Rule.php index 61f29e36670ad..b54637407ab16 100644 --- a/app/code/Magento/SalesRule/Model/Resource/Rule.php +++ b/app/code/Magento/SalesRule/Model/Resource/Rule.php @@ -43,20 +43,18 @@ class Rule extends \Magento\Rule\Model\Resource\AbstractResource protected $_resourceCoupon; /** - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param \Magento\Framework\Stdlib\String $string * @param \Magento\SalesRule\Model\Resource\Coupon $resourceCoupon */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, \Magento\Framework\Stdlib\String $string, \Magento\SalesRule\Model\Resource\Coupon $resourceCoupon ) { $this->string = $string; $this->_resourceCoupon = $resourceCoupon; - parent::__construct($resource, $transactionManager); + parent::__construct($context); } /** diff --git a/app/code/Magento/Search/Model/Resource/Query.php b/app/code/Magento/Search/Model/Resource/Query.php index 62b17571ea1a8..640a14a282e2a 100644 --- a/app/code/Magento/Search/Model/Resource/Query.php +++ b/app/code/Magento/Search/Model/Resource/Query.php @@ -31,20 +31,18 @@ class Query extends AbstractDb protected $dateTime; /** - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param \Magento\Framework\Stdlib\DateTime\DateTime $date * @param \Magento\Framework\Stdlib\DateTime $dateTime */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, \Magento\Framework\Stdlib\DateTime\DateTime $date, \Magento\Framework\Stdlib\DateTime $dateTime ) { $this->_date = $date; $this->dateTime = $dateTime; - parent::__construct($resource, $transactionManager); + parent::__construct($context); } /** diff --git a/app/code/Magento/Sitemap/Model/Resource/Catalog/Category.php b/app/code/Magento/Sitemap/Model/Resource/Catalog/Category.php index c2d12ca0df954..e1d146a6aed08 100644 --- a/app/code/Magento/Sitemap/Model/Resource/Catalog/Category.php +++ b/app/code/Magento/Sitemap/Model/Resource/Catalog/Category.php @@ -39,20 +39,18 @@ class Category extends \Magento\Framework\Model\Resource\Db\AbstractDb protected $_categoryResource; /** - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param \Magento\Framework\Store\StoreManagerInterface $storeManager * @param \Magento\Catalog\Model\Resource\Category $categoryResource */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, \Magento\Framework\Store\StoreManagerInterface $storeManager, \Magento\Catalog\Model\Resource\Category $categoryResource ) { $this->_storeManager = $storeManager; $this->_categoryResource = $categoryResource; - parent::__construct($resource, $transactionManager); + parent::__construct($context); } /** diff --git a/app/code/Magento/Sitemap/Model/Resource/Catalog/Product.php b/app/code/Magento/Sitemap/Model/Resource/Catalog/Product.php index 1362348715d00..236beae39f37b 100644 --- a/app/code/Magento/Sitemap/Model/Resource/Catalog/Product.php +++ b/app/code/Magento/Sitemap/Model/Resource/Catalog/Product.php @@ -83,8 +83,7 @@ class Product extends \Magento\Framework\Model\Resource\Db\AbstractDb protected $_mediaConfig; /** - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param \Magento\Sitemap\Helper\Data $sitemapData * @param \Magento\Catalog\Model\Resource\Product $productResource * @param \Magento\Framework\Store\StoreManagerInterface $storeManager @@ -95,8 +94,7 @@ class Product extends \Magento\Framework\Model\Resource\Db\AbstractDb * @param \Magento\Catalog\Model\Product\Media\Config $mediaConfig */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, \Magento\Sitemap\Helper\Data $sitemapData, \Magento\Catalog\Model\Resource\Product $productResource, \Magento\Framework\Store\StoreManagerInterface $storeManager, @@ -114,7 +112,7 @@ public function __construct( $this->_eavConfigFactory = $eavConfigFactory; $this->_mediaConfig = $mediaConfig; $this->_sitemapData = $sitemapData; - parent::__construct($resource, $transactionManager); + parent::__construct($context); } /** diff --git a/app/code/Magento/Tax/Model/Resource/Calculation.php b/app/code/Magento/Tax/Model/Resource/Calculation.php index 46f972e1ef529..1012700f1fda5 100644 --- a/app/code/Magento/Tax/Model/Resource/Calculation.php +++ b/app/code/Magento/Tax/Model/Resource/Calculation.php @@ -44,20 +44,18 @@ class Calculation extends \Magento\Framework\Model\Resource\Db\AbstractDb protected $_storeManager; /** - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\Framework\Store\StoreManagerInterface $storeManager */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, \Magento\Tax\Helper\Data $taxData, \Magento\Framework\Store\StoreManagerInterface $storeManager ) { $this->_taxData = $taxData; $this->_storeManager = $storeManager; - parent::__construct($resource, $transactionManager); + parent::__construct($context); } /** diff --git a/app/code/Magento/Tax/Model/Resource/Report/Tax.php b/app/code/Magento/Tax/Model/Resource/Report/Tax.php index 394036c31b7bf..d6c3fbc1b4df7 100644 --- a/app/code/Magento/Tax/Model/Resource/Report/Tax.php +++ b/app/code/Magento/Tax/Model/Resource/Report/Tax.php @@ -22,8 +22,7 @@ class Tax extends \Magento\Reports\Model\Resource\Report\AbstractReport protected $_updatedAtFactory; /** - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate * @param \Magento\Reports\Model\FlagFactory $reportsFlagFactory @@ -33,8 +32,7 @@ class Tax extends \Magento\Reports\Model\Resource\Report\AbstractReport * @param \Magento\Tax\Model\Resource\Report\Tax\UpdatedatFactory $updatedAtFactory */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, \Psr\Log\LoggerInterface $logger, \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate, \Magento\Reports\Model\FlagFactory $reportsFlagFactory, @@ -46,8 +44,7 @@ public function __construct( $this->_createdAtFactory = $createdAtFactory; $this->_updatedAtFactory = $updatedAtFactory; parent::__construct( - $resource, - $transactionManager, + $context, $logger, $localeDate, $reportsFlagFactory, diff --git a/app/code/Magento/Theme/Model/Resource/Design.php b/app/code/Magento/Theme/Model/Resource/Design.php index e19fc35294791..89dcb32b48d22 100644 --- a/app/code/Magento/Theme/Model/Resource/Design.php +++ b/app/code/Magento/Theme/Model/Resource/Design.php @@ -22,17 +22,15 @@ class Design extends \Magento\Framework\Model\Resource\Db\AbstractDb protected $dateTime; /** - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param DateTime $dateTime */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, DateTime $dateTime ) { $this->dateTime = $dateTime; - parent::__construct($resource, $transactionManager); + parent::__construct($context); } /** diff --git a/app/code/Magento/Translation/Model/Resource/String.php b/app/code/Magento/Translation/Model/Resource/String.php index 8b4ce2f3b7ebd..266a98976b458 100644 --- a/app/code/Magento/Translation/Model/Resource/String.php +++ b/app/code/Magento/Translation/Model/Resource/String.php @@ -23,15 +23,13 @@ class String extends \Magento\Framework\Model\Resource\Db\AbstractDb protected $scope; /** - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param \Magento\Framework\Locale\ResolverInterface $localeResolver * @param \Magento\Framework\App\ScopeResolverInterface $scopeResolver * @param string|null $scope */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, \Magento\Framework\Locale\ResolverInterface $localeResolver, \Magento\Framework\App\ScopeResolverInterface $scopeResolver, $scope = null @@ -39,7 +37,7 @@ public function __construct( $this->_localeResolver = $localeResolver; $this->scopeResolver = $scopeResolver; $this->scope = $scope; - parent::__construct($resource, $transactionManager); + parent::__construct($context); } /** diff --git a/app/code/Magento/Translation/Model/Resource/Translate.php b/app/code/Magento/Translation/Model/Resource/Translate.php index abaed90ca2ba9..c62846d02c7aa 100644 --- a/app/code/Magento/Translation/Model/Resource/Translate.php +++ b/app/code/Magento/Translation/Model/Resource/Translate.php @@ -19,20 +19,18 @@ class Translate extends \Magento\Framework\Model\Resource\Db\AbstractDb implemen protected $scope; /** - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param \Magento\Framework\App\ScopeResolverInterface $scopeResolver * @param null|string $scope */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, \Magento\Framework\App\ScopeResolverInterface $scopeResolver, $scope = null ) { $this->scopeResolver = $scopeResolver; $this->scope = $scope; - parent::__construct($resource, $transactionManager); + parent::__construct($context); } /** diff --git a/app/code/Magento/User/Model/Resource/User.php b/app/code/Magento/User/Model/Resource/User.php index 778d7b4a08f29..60e219c63a619 100644 --- a/app/code/Magento/User/Model/Resource/User.php +++ b/app/code/Magento/User/Model/Resource/User.php @@ -46,20 +46,18 @@ class User extends \Magento\Framework\Model\Resource\Db\AbstractDb /** * Construct * - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param \Magento\Framework\Acl\CacheInterface $aclCache * @param \Magento\Authorization\Model\RoleFactory $roleFactory * @param \Magento\Framework\Stdlib\DateTime $dateTime */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, \Magento\Framework\Acl\CacheInterface $aclCache, \Magento\Authorization\Model\RoleFactory $roleFactory, \Magento\Framework\Stdlib\DateTime $dateTime ) { - parent::__construct($resource, $transactionManager); + parent::__construct($context); $this->_aclCache = $aclCache; $this->_roleFactory = $roleFactory; $this->dateTime = $dateTime; diff --git a/app/code/Magento/Weee/Model/Resource/Attribute/Backend/Weee/Tax.php b/app/code/Magento/Weee/Model/Resource/Attribute/Backend/Weee/Tax.php index 41e5d2b0b4ab9..bab07df9222f4 100644 --- a/app/code/Magento/Weee/Model/Resource/Attribute/Backend/Weee/Tax.php +++ b/app/code/Magento/Weee/Model/Resource/Attribute/Backend/Weee/Tax.php @@ -18,17 +18,15 @@ class Tax extends \Magento\Framework\Model\Resource\Db\AbstractDb protected $_storeManager; /** - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param \Magento\Framework\Store\StoreManagerInterface $storeManager */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, \Magento\Framework\Store\StoreManagerInterface $storeManager ) { $this->_storeManager = $storeManager; - parent::__construct($resource, $transactionManager); + parent::__construct($context); } /** diff --git a/app/code/Magento/Weee/Model/Resource/Tax.php b/app/code/Magento/Weee/Model/Resource/Tax.php index d595de6e6f0a7..4e65894c71b2e 100644 --- a/app/code/Magento/Weee/Model/Resource/Tax.php +++ b/app/code/Magento/Weee/Model/Resource/Tax.php @@ -19,17 +19,15 @@ class Tax extends \Magento\Framework\Model\Resource\Db\AbstractDb protected $dateTime; /** - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param \Magento\Framework\Stdlib\DateTime $dateTime */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, \Magento\Framework\Stdlib\DateTime $dateTime ) { $this->dateTime = $dateTime; - parent::__construct($resource, $transactionManager); + parent::__construct($context); } /** diff --git a/lib/internal/Magento/Framework/Model/Resource/Db/AbstractDb.php b/lib/internal/Magento/Framework/Model/Resource/Db/AbstractDb.php index 8df0c08e2e55b..eee36f2cf0b51 100644 --- a/lib/internal/Magento/Framework/Model/Resource/Db/AbstractDb.php +++ b/lib/internal/Magento/Framework/Model/Resource/Db/AbstractDb.php @@ -126,18 +126,13 @@ abstract class AbstractDb extends \Magento\Framework\Model\Resource\AbstractReso protected $objectRelationProcessor; /** - * @param \Magento\Framework\App\Resource $resource - * @param TransactionManagerInterface $transactionManager - * @param ObjectRelationProcessor $objectRelationProcessor - */ - public function __construct( - \Magento\Framework\App\Resource $resource, - TransactionManagerInterface $transactionManager, - ObjectRelationProcessor $objectRelationProcessor - ) { - $this->transactionManager = $transactionManager; - $this->_resources = $resource; - $this->objectRelationProcessor = $objectRelationProcessor; + * @param Context $context + */ + public function __construct(\Magento\Framework\Model\Resource\Db\Context $context) + { + $this->transactionManager = $context->getTransactionManager(); + $this->_resources = $context->getResources(); + $this->objectRelationProcessor = $context->getObjectRelationProcessor(); parent::__construct(); } diff --git a/lib/internal/Magento/Framework/Model/Resource/Db/Context.php b/lib/internal/Magento/Framework/Model/Resource/Db/Context.php new file mode 100644 index 0000000000000..d86c0efa461ac --- /dev/null +++ b/lib/internal/Magento/Framework/Model/Resource/Db/Context.php @@ -0,0 +1,64 @@ +transactionManager = $transactionManager; + $this->resources = $resource; + $this->objectRelationProcessor = $objectRelationProcessor; + } + + /** + * @return \Magento\Framework\App\Resource + */ + public function getResources() + { + return $this->resources; + } + + /** + * @return TransactionManagerInterface + */ + public function getTransactionManager() + { + return $this->transactionManager; + } + + /** + * @return ObjectRelationProcessor + */ + public function getObjectRelationProcessor() + { + return $this->objectRelationProcessor; + } +} From 516ea06be3664d8dea4012758d6952fa64cb93e8 Mon Sep 17 00:00:00 2001 From: Olexii Korshenko Date: Fri, 6 Feb 2015 15:42:53 +0200 Subject: [PATCH 17/44] MAGETWO-32974: DB Foreign Keys Management on the Application Level - fixed installer logic --- .../module/Magento/Setup/src/Module/SetupFactory.php | 7 +++++-- .../module/Magento/Setup/src/Module/SetupModule.php | 12 +++++------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/setup/module/Magento/Setup/src/Module/SetupFactory.php b/setup/module/Magento/Setup/src/Module/SetupFactory.php index 22ff5185a3c36..06eb5c4f17676 100644 --- a/setup/module/Magento/Setup/src/Module/SetupFactory.php +++ b/setup/module/Magento/Setup/src/Module/SetupFactory.php @@ -59,8 +59,11 @@ public function createSetupModule(LoggerInterface $log, $moduleName) $this->serviceLocator->get('Magento\Framework\Module\ModuleList'), $this->serviceLocator->get('Magento\Setup\Module\Setup\FileResolver'), $moduleName, - $this->getResource(), - $this->serviceLocator->get('Magento\Framework\Model\Resource\Db\TransactionManager') + new \Magento\Framework\Model\Resource\Db\Context( + $this->getResource(), + $this->serviceLocator->get('Magento\Framework\Model\Resource\Db\TransactionManager'), + $this->serviceLocator->get('Magento\Framework\Model\Resource\Db\ObjectRelationProcessor') + ) ); } diff --git a/setup/module/Magento/Setup/src/Module/SetupModule.php b/setup/module/Magento/Setup/src/Module/SetupModule.php index 0430d1fd933f2..20a302a1fcbfc 100644 --- a/setup/module/Magento/Setup/src/Module/SetupModule.php +++ b/setup/module/Magento/Setup/src/Module/SetupModule.php @@ -57,9 +57,8 @@ class SetupModule extends Setup * @param LoggerInterface $log * @param ModuleListInterface $moduleList * @param SetupFileResolver $fileResolver - * @param string $moduleName - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager + * @param $moduleName + * @param \Magento\Framework\Model\Resource\Db\Context $context * @param string $connectionName */ public function __construct( @@ -67,15 +66,14 @@ public function __construct( ModuleListInterface $moduleList, SetupFileResolver $fileResolver, $moduleName, - \Magento\Framework\App\Resource $resource, - \Magento\Framework\Model\Resource\Db\TransactionManagerInterface $transactionManager, + \Magento\Framework\Model\Resource\Db\Context $context, $connectionName = SetupInterface::DEFAULT_SETUP_CONNECTION ) { - parent::__construct($resource, $connectionName); + parent::__construct($context->getResources(), $connectionName); $this->logger = $log; $this->fileResolver = $fileResolver; $this->moduleConfig = $moduleList->getOne($moduleName); - $this->resource = new Resource($resource, $transactionManager); + $this->resource = new Resource($context); $this->resourceName = $this->fileResolver->getResourceCode($moduleName); } From 31d032772a024dd88b013195e45384612b1675a4 Mon Sep 17 00:00:00 2001 From: Olexii Korshenko Date: Fri, 6 Feb 2015 16:31:06 +0200 Subject: [PATCH 18/44] MAGETWO-32974: DB Foreign Keys Management on the Application Level - fixed integration tests --- lib/internal/Magento/Framework/Model/Resource/Db/AbstractDb.php | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/internal/Magento/Framework/Model/Resource/Db/AbstractDb.php b/lib/internal/Magento/Framework/Model/Resource/Db/AbstractDb.php index eee36f2cf0b51..a0f0217e2b189 100644 --- a/lib/internal/Magento/Framework/Model/Resource/Db/AbstractDb.php +++ b/lib/internal/Magento/Framework/Model/Resource/Db/AbstractDb.php @@ -474,6 +474,7 @@ public function delete(\Magento\Framework\Model\AbstractModel $object) $object->beforeDelete(); $this->_beforeDelete($object); $this->objectRelationProcessor->delete( + $this->transactionManager, $connection, $this->getMainTable(), $this->_getWriteAdapter()->quoteInto($this->getIdFieldName() . '=?', $object->getId()), From 7253246707a2ca404a40974b22b7a05061c753e7 Mon Sep 17 00:00:00 2001 From: Olexii Korshenko Date: Fri, 6 Feb 2015 18:47:56 +0200 Subject: [PATCH 19/44] MAGETWO-32974: DB Foreign Keys Management on the Application Level --- .../Model/Resource/Db/AbstractDb.php | 2 - .../Model/Resource/Db/TransactionManager.php | 57 +++++++++++-------- .../Db/TransactionManagerInterface.php | 21 ------- 3 files changed, 32 insertions(+), 48 deletions(-) diff --git a/lib/internal/Magento/Framework/Model/Resource/Db/AbstractDb.php b/lib/internal/Magento/Framework/Model/Resource/Db/AbstractDb.php index a0f0217e2b189..015fee75bcc77 100644 --- a/lib/internal/Magento/Framework/Model/Resource/Db/AbstractDb.php +++ b/lib/internal/Magento/Framework/Model/Resource/Db/AbstractDb.php @@ -399,7 +399,6 @@ public function save(\Magento\Framework\Model\AbstractModel $object) $object->beforeSave(); if ($object->isSaveAllowed()) { $this->_serializeFields($object); - $this->transactionManager->validate($this->getMainTable(), $object->getData()); $this->_beforeSave($object); $this->_checkUnique($object); if (!is_null($object->getId()) && (!$this->_useIsObjectNew || !$object->isObjectNew())) { @@ -480,7 +479,6 @@ public function delete(\Magento\Framework\Model\AbstractModel $object) $this->_getWriteAdapter()->quoteInto($this->getIdFieldName() . '=?', $object->getId()), $object->getData() ); - $this->transactionManager->end($connection); $this->_afterDelete($object); $object->isDeleted(true); $object->afterDelete(); diff --git a/lib/internal/Magento/Framework/Model/Resource/Db/TransactionManager.php b/lib/internal/Magento/Framework/Model/Resource/Db/TransactionManager.php index a54cd97fe416e..d825e8c8ab9dd 100644 --- a/lib/internal/Magento/Framework/Model/Resource/Db/TransactionManager.php +++ b/lib/internal/Magento/Framework/Model/Resource/Db/TransactionManager.php @@ -10,37 +10,32 @@ class TransactionManager implements TransactionManagerInterface { - /** - * @var Connection - */ - protected $connection = null; + const STATE_IN_PROGRESS = 'in progress'; + const STATE_FINISHED = 'finished'; /** - * {@inheritdoc} + * @var array */ - public function delete(Connection $connection, $table, $condition, array $involvedData) - { - $connection->delete($table, $condition); - } + protected $participants; /** * {@inheritdoc} */ public function start(Connection $connection) { - $this->connection = $connection; - $this->connection->beginTransaction(); + $key = $this->getConnectionKey($connection); + $this->participants[$key]['item'] = $connection; + $this->participants[$key]['state'] = self::STATE_IN_PROGRESS; + $connection->beginTransaction(); } /** - * Vote that connection is ready to commit - * - * @param Connection $connection - * @return void + * {@inheritdoc} */ public function end(Connection $connection) { - + $key = $this->getConnectionKey($connection); + $this->participants[$key]['state'] = self::STATE_FINISHED; } /** @@ -48,7 +43,17 @@ public function end(Connection $connection) */ public function commit() { - $this->connection->commit(); + foreach ($this->participants as $item) { + if ($item['state'] != self::STATE_FINISHED) { + throw new \Exception('Incomplete transactions. Cannot update row: a foreign key constraint fails'); + } + } + + foreach ($this->participants as $item) { + /** @var \Magento\Framework\DB\Adapter\AdapterInterface $connection */ + $connection = $item['item']; + $connection->commit(); + } } /** @@ -56,19 +61,21 @@ public function commit() */ public function rollBack() { - $this->connection->rollBack(); + foreach ($this->participants as $item) { + /** @var \Magento\Framework\DB\Adapter\AdapterInterface $connection */ + $connection = $item['item']; + $connection->rollBack(); + } } /** - * Validate data that is about to be saved. Check that referenced entity(s) exists. + * Get object key * - * @param string $table - * @param array $involvedData - * @return void - * @throws \LogicException + * @param Connection $connection + * @return string */ - public function validate($table, array $involvedData) + protected function getConnectionKey(Connection $connection) { - + return spl_object_hash($connection); } } diff --git a/lib/internal/Magento/Framework/Model/Resource/Db/TransactionManagerInterface.php b/lib/internal/Magento/Framework/Model/Resource/Db/TransactionManagerInterface.php index 0ff1c3f810525..27871216d1239 100644 --- a/lib/internal/Magento/Framework/Model/Resource/Db/TransactionManagerInterface.php +++ b/lib/internal/Magento/Framework/Model/Resource/Db/TransactionManagerInterface.php @@ -10,27 +10,6 @@ interface TransactionManagerInterface { - /** - * Process delete operation - * - * @param Connection $connection - * @param string $table - * @param string $condition - * @param array $involvedData - * @return void - */ - public function delete(Connection $connection, $table, $condition, array $involvedData); - - /** - * Validate data that is about to be saved. Check that referenced entity(s) exists. - * - * @param string $table - * @param array $involvedData - * @return void - * @throws \LogicException - */ - public function validate($table, array $involvedData); - /** * Start transaction * From 45f1ece36b817cc0cf6f36bda6960a103bc985c6 Mon Sep 17 00:00:00 2001 From: Ievgen Shakhsuvarov Date: Fri, 6 Feb 2015 18:52:19 +0200 Subject: [PATCH 20/44] MAGETWO-32831: Can not checkout with multiple addresses --- app/code/Magento/GiftMessage/Model/Plugin/QuoteItem.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/GiftMessage/Model/Plugin/QuoteItem.php b/app/code/Magento/GiftMessage/Model/Plugin/QuoteItem.php index bd4bbe9e1c8eb..f2538b84b6a23 100644 --- a/app/code/Magento/GiftMessage/Model/Plugin/QuoteItem.php +++ b/app/code/Magento/GiftMessage/Model/Plugin/QuoteItem.php @@ -35,7 +35,7 @@ public function aroundConvert( \Magento\Quote\Model\Quote\Item\ToOrderItem $subject, Closure $proceed, \Magento\Quote\Model\Quote\Item\AbstractItem $item, - $additional + $additional = [] ) { /** @var $orderItem Item */ $orderItem = $proceed($item, $additional); From e53ec68a0c12b87336eac472022d0f3ca6a2a62e Mon Sep 17 00:00:00 2001 From: Olexii Korshenko Date: Mon, 9 Feb 2015 13:51:37 +0200 Subject: [PATCH 21/44] MAGETWO-32974: DB Foreign Keys Management on the Application Level --- .../Framework/Model/Resource/Db/TransactionManager.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/internal/Magento/Framework/Model/Resource/Db/TransactionManager.php b/lib/internal/Magento/Framework/Model/Resource/Db/TransactionManager.php index d825e8c8ab9dd..d91a1ce2b6f54 100644 --- a/lib/internal/Magento/Framework/Model/Resource/Db/TransactionManager.php +++ b/lib/internal/Magento/Framework/Model/Resource/Db/TransactionManager.php @@ -24,9 +24,12 @@ class TransactionManager implements TransactionManagerInterface public function start(Connection $connection) { $key = $this->getConnectionKey($connection); - $this->participants[$key]['item'] = $connection; - $this->participants[$key]['state'] = self::STATE_IN_PROGRESS; - $connection->beginTransaction(); + if (!isset($this->participants[$key])) { + $this->participants[$key]['item'] = $connection; + $this->participants[$key]['state'] = self::STATE_IN_PROGRESS; + $connection->beginTransaction(); + } + return $connection; } /** From 746a6f19dbc239d4bf470c44363aa6f9cb4a7bc1 Mon Sep 17 00:00:00 2001 From: Alex Akimov Date: Mon, 9 Feb 2015 16:08:50 +0200 Subject: [PATCH 22/44] MAGETWO-33650: Validation of Constraint before Model Save --- .../Framework/Model/Resource/Db/AbstractDb.php | 1 + .../Model/Resource/Db/ObjectRelationProcessor.php | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/lib/internal/Magento/Framework/Model/Resource/Db/AbstractDb.php b/lib/internal/Magento/Framework/Model/Resource/Db/AbstractDb.php index 015fee75bcc77..93776267f2147 100644 --- a/lib/internal/Magento/Framework/Model/Resource/Db/AbstractDb.php +++ b/lib/internal/Magento/Framework/Model/Resource/Db/AbstractDb.php @@ -401,6 +401,7 @@ public function save(\Magento\Framework\Model\AbstractModel $object) $this->_serializeFields($object); $this->_beforeSave($object); $this->_checkUnique($object); + $this->objectRelationProcessor->validateDataIntegrity($this->getMainTable(), $object->getData()); if (!is_null($object->getId()) && (!$this->_useIsObjectNew || !$object->isObjectNew())) { $condition = $this->_getWriteAdapter()->quoteInto($this->getIdFieldName() . '=?', $object->getId()); /** diff --git a/lib/internal/Magento/Framework/Model/Resource/Db/ObjectRelationProcessor.php b/lib/internal/Magento/Framework/Model/Resource/Db/ObjectRelationProcessor.php index d11e463f3b1a2..df1a7f9973423 100644 --- a/lib/internal/Magento/Framework/Model/Resource/Db/ObjectRelationProcessor.php +++ b/lib/internal/Magento/Framework/Model/Resource/Db/ObjectRelationProcessor.php @@ -31,4 +31,15 @@ public function delete( $connection->delete($table, $condition); $transactionManager->end($connection); } + + /** + * Validate integrity of the given data + * + * @param string $table + * @param array $involvedData + */ + public function validateDataIntegrity($table, array $involvedData) + { + return; + } } From 459efe63420ed0f4db05a63f82f49ede2d48712c Mon Sep 17 00:00:00 2001 From: Olexii Korshenko Date: Mon, 9 Feb 2015 17:01:02 +0200 Subject: [PATCH 23/44] MAGETWO-32974: DB Foreign Keys Management on the Application Level - fixed commit logic --- .../Resource/Db/ObjectRelationProcessor.php | 1 - .../Model/Resource/Db/TransactionManager.php | 38 ++++--------------- .../Db/TransactionManagerInterface.php | 8 ---- 3 files changed, 7 insertions(+), 40 deletions(-) diff --git a/lib/internal/Magento/Framework/Model/Resource/Db/ObjectRelationProcessor.php b/lib/internal/Magento/Framework/Model/Resource/Db/ObjectRelationProcessor.php index df1a7f9973423..98bd0cfbe788e 100644 --- a/lib/internal/Magento/Framework/Model/Resource/Db/ObjectRelationProcessor.php +++ b/lib/internal/Magento/Framework/Model/Resource/Db/ObjectRelationProcessor.php @@ -29,7 +29,6 @@ public function delete( array $involvedData ) { $connection->delete($table, $condition); - $transactionManager->end($connection); } /** diff --git a/lib/internal/Magento/Framework/Model/Resource/Db/TransactionManager.php b/lib/internal/Magento/Framework/Model/Resource/Db/TransactionManager.php index d91a1ce2b6f54..b25178ef0dc38 100644 --- a/lib/internal/Magento/Framework/Model/Resource/Db/TransactionManager.php +++ b/lib/internal/Magento/Framework/Model/Resource/Db/TransactionManager.php @@ -10,11 +10,8 @@ class TransactionManager implements TransactionManagerInterface { - const STATE_IN_PROGRESS = 'in progress'; - const STATE_FINISHED = 'finished'; - /** - * @var array + * @var Connection[] */ protected $participants; @@ -23,38 +20,18 @@ class TransactionManager implements TransactionManagerInterface */ public function start(Connection $connection) { - $key = $this->getConnectionKey($connection); - if (!isset($this->participants[$key])) { - $this->participants[$key]['item'] = $connection; - $this->participants[$key]['state'] = self::STATE_IN_PROGRESS; - $connection->beginTransaction(); - } + $this->participants[] = $connection; + $connection->beginTransaction(); return $connection; } - /** - * {@inheritdoc} - */ - public function end(Connection $connection) - { - $key = $this->getConnectionKey($connection); - $this->participants[$key]['state'] = self::STATE_FINISHED; - } - /** * {@inheritdoc} */ public function commit() { - foreach ($this->participants as $item) { - if ($item['state'] != self::STATE_FINISHED) { - throw new \Exception('Incomplete transactions. Cannot update row: a foreign key constraint fails'); - } - } - - foreach ($this->participants as $item) { - /** @var \Magento\Framework\DB\Adapter\AdapterInterface $connection */ - $connection = $item['item']; + /** @var \Magento\Framework\DB\Adapter\AdapterInterface $connection */ + while ($connection = array_pop($this->participants)) { $connection->commit(); } } @@ -64,9 +41,8 @@ public function commit() */ public function rollBack() { - foreach ($this->participants as $item) { - /** @var \Magento\Framework\DB\Adapter\AdapterInterface $connection */ - $connection = $item['item']; + /** @var \Magento\Framework\DB\Adapter\AdapterInterface $connection */ + while ($connection = array_pop($this->participants)) { $connection->rollBack(); } } diff --git a/lib/internal/Magento/Framework/Model/Resource/Db/TransactionManagerInterface.php b/lib/internal/Magento/Framework/Model/Resource/Db/TransactionManagerInterface.php index 27871216d1239..60dfc736f532e 100644 --- a/lib/internal/Magento/Framework/Model/Resource/Db/TransactionManagerInterface.php +++ b/lib/internal/Magento/Framework/Model/Resource/Db/TransactionManagerInterface.php @@ -18,14 +18,6 @@ interface TransactionManagerInterface */ public function start(Connection $connection); - /** - * Vote that connection is ready to commit - * - * @param Connection $connection - * @return void - */ - public function end(Connection $connection); - /** * Commit transaction * From a608bbd37aa723b41f67b4a15060dd27596c1911 Mon Sep 17 00:00:00 2001 From: Olexii Korshenko Date: Tue, 10 Feb 2015 13:50:54 +0200 Subject: [PATCH 24/44] MAGETWO-32974: DB Foreign Keys Management on the Application Level --- app/code/Magento/CatalogInventory/Model/Resource/Stock/Item.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/CatalogInventory/Model/Resource/Stock/Item.php b/app/code/Magento/CatalogInventory/Model/Resource/Stock/Item.php index b2a8404aa1de9..b182d738370fc 100644 --- a/app/code/Magento/CatalogInventory/Model/Resource/Stock/Item.php +++ b/app/code/Magento/CatalogInventory/Model/Resource/Stock/Item.php @@ -36,7 +36,7 @@ class Item extends \Magento\Framework\Model\Resource\Db\AbstractDb public function __construct( \Magento\Framework\Model\Resource\Db\Context $context, Processor $processor, - $resourcePrefix = nul + $resourcePrefix = null ) { $this->stockIndexerProcessor = $processor; parent::__construct($context, $resourcePrefix); From 7e12e9e183bc505ea7fd9c28f7208fa9e8b42bfa Mon Sep 17 00:00:00 2001 From: Stanislav Idolov Date: Tue, 10 Feb 2015 16:34:01 +0200 Subject: [PATCH 25/44] MAGETWO-33783: Unit tests coverage --- .../Model/Resource/Product/FlatTest.php | 2 +- .../Core/Model/Resource/Db/AbstractTest.php | 4 +- .../Customer/Model/Resource/GroupTest.php | 29 ++++++++- .../Import/CustomerComposite/DataTest.php | 20 +++---- .../Resource/Entity/Attribute/SetTest.php | 60 +++++++++++++++++-- .../Model/Resource/Entity/AttributeTest.php | 15 ++++- .../testsuite/Magento/Framework/FlagTest.php | 13 ++-- .../Model/Resource/Db/AbstractDbTest.php | 53 +++++++++++++++- .../Quote/Model/Resource/QuoteTest.php | 5 +- .../Resource/Order/Creditmemo/CommentTest.php | 17 +++++- .../Resource/Order/Creditmemo/GridTest.php | 7 ++- .../Sales/Model/Resource/Order/GridTest.php | 7 ++- .../Resource/Order/Invoice/CommentTest.php | 16 ++++- .../Model/Resource/Order/Invoice/GridTest.php | 6 +- .../Resource/Order/Shipment/CommentTest.php | 16 ++++- .../Resource/Order/Shipment/GridTest.php | 6 +- .../Resource/Order/Shipment/TrackTest.php | 16 ++++- .../Resource/Order/Status/HistoryTest.php | 16 ++++- .../Sales/Model/Resource/OrderTest.php | 5 +- .../Attribute/Backend/Weee/TaxTest.php | 5 +- 20 files changed, 271 insertions(+), 47 deletions(-) diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Model/Resource/Product/FlatTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Model/Resource/Product/FlatTest.php index dcc7de50a43c6..fd84bdfed2acf 100644 --- a/dev/tests/unit/testsuite/Magento/Catalog/Model/Resource/Product/FlatTest.php +++ b/dev/tests/unit/testsuite/Magento/Catalog/Model/Resource/Product/FlatTest.php @@ -45,7 +45,7 @@ public function setUp() ); $this->_model = new \Magento\Catalog\Model\Resource\Product\Flat( - $this->getMock('Magento\Framework\App\Resource', [], [], '', false), + $this->getMock('Magento\Framework\Model\Resource\Db\Context', [], [], '', false), $this->_storeManagerInterface, $this->getMock('Magento\Catalog\Model\Config', [], [], '', false) ); diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Resource/Db/AbstractTest.php b/dev/tests/unit/testsuite/Magento/Core/Model/Resource/Db/AbstractTest.php index 910071f149816..684b4370e0d1a 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Resource/Db/AbstractTest.php +++ b/dev/tests/unit/testsuite/Magento/Core/Model/Resource/Db/AbstractTest.php @@ -24,10 +24,12 @@ class AbstractTest extends \PHPUnit_Framework_TestCase protected function setUp() { $this->_resource = $this->getMock('Magento\Framework\App\Resource', [], [], '', false, false); + $contextMock = $this->getMock('\Magento\Framework\Model\Resource\Db\Context', ['getResources'], [], '', false); + $contextMock->expects($this->once())->method('getResources')->willReturn($this->_resource); $this->_model = $this->getMock( 'Magento\Framework\Model\Resource\Db\AbstractDb', ['_construct', '_getWriteAdapter'], - [$this->_resource] + [$contextMock] ); } diff --git a/dev/tests/unit/testsuite/Magento/Customer/Model/Resource/GroupTest.php b/dev/tests/unit/testsuite/Magento/Customer/Model/Resource/GroupTest.php index 496164e7d3e30..62612ced490ff 100644 --- a/dev/tests/unit/testsuite/Magento/Customer/Model/Resource/GroupTest.php +++ b/dev/tests/unit/testsuite/Magento/Customer/Model/Resource/GroupTest.php @@ -30,6 +30,9 @@ class GroupTest extends \PHPUnit_Framework_TestCase /** @var \PHPUnit_Framework_MockObject_MockObject */ protected $groupManagement; + /** @var \PHPUnit_Framework_MockObject_MockObject */ + protected $relationProcessorMock; + protected function setUp() { $this->resource = $this->getMock('Magento\Framework\App\Resource', [], [], '', false); @@ -50,10 +53,32 @@ protected function setUp() $this->groupModel = $this->getMock('Magento\Customer\Model\Group', [], [], '', false); + $contextMock = $this->getMock('\Magento\Framework\Model\Resource\Db\Context', [], [], '', false); + $contextMock->expects($this->once())->method('getResources')->willReturn($this->resource); + + $this->relationProcessorMock = $this->getMock( + '\Magento\Framework\Model\Resource\Db\ObjectRelationProcessor', + [], + [], + '', + false + ); + + $transactionManagerMock = $this->getMock('\Magento\Framework\Model\Resource\Db\TransactionManagerInterface'); + $transactionManagerMock->expects($this->once()) + ->method('start') + ->willReturn($this->getMock('\Magento\Framework\DB\Adapter\AdapterInterface')); + $contextMock->expects($this->once()) + ->method('getTransactionManager') + ->willReturn($transactionManagerMock); + $contextMock->expects($this->once()) + ->method('getObjectRelationProcessor') + ->willReturn($this->relationProcessorMock); + $this->groupResourceModel = (new ObjectManagerHelper($this))->getObject( 'Magento\Customer\Model\Resource\Group', [ - 'resource' => $this->resource, + 'context' => $contextMock, 'groupManagement' => $this->groupManagement, 'customersFactory' => $this->customersFactory, ] @@ -93,6 +118,8 @@ public function testDelete() $this->customersFactory->expects($this->once())->method('create') ->will($this->returnValue($customerCollection)); + $this->relationProcessorMock->expects($this->once())->method('delete'); + $this->groupModel->expects($this->any())->method('getData')->willReturn(['data' => 'value']); $this->groupResourceModel->delete($this->groupModel); } } diff --git a/dev/tests/unit/testsuite/Magento/CustomerImportExport/Model/Resource/Import/CustomerComposite/DataTest.php b/dev/tests/unit/testsuite/Magento/CustomerImportExport/Model/Resource/Import/CustomerComposite/DataTest.php index ccb25131c0b41..dd1d9e6b47d3e 100644 --- a/dev/tests/unit/testsuite/Magento/CustomerImportExport/Model/Resource/Import/CustomerComposite/DataTest.php +++ b/dev/tests/unit/testsuite/Magento/CustomerImportExport/Model/Resource/Import/CustomerComposite/DataTest.php @@ -14,11 +14,6 @@ class DataTest extends \PHPUnit_Framework_TestCase { - /** - * @var \Magento\TestFramework\Helper\ObjectManager - */ - protected $objectManager; - /** * Array of customer attributes * @@ -104,14 +99,13 @@ public function testGetNextBunch($entityType, $bunchData, $expectedData) $coreHelper = $this->getMock('Magento\Core\Helper\Data', ['__construct'], [], '', false); unset($dependencies['resource'], $dependencies['json_helper']); - $this->objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); - $object = $this->objectManager->getObject( - '\Magento\CustomerImportExport\Model\Resource\Import\CustomerComposite\Data', - [ - 'resource' => $resource, - 'coreHelper' => $coreHelper, - 'arguments' => $dependencies, - ] + $contextMock = $this->getMock('\Magento\Framework\Model\Resource\Db\Context', [], [], '', false); + $contextMock->expects($this->once())->method('getResources')->willReturn($resource); + + $object = new Data( + $contextMock, + $coreHelper, + $dependencies ); $this->assertEquals($expectedData, $object->getNextBunch()); } diff --git a/dev/tests/unit/testsuite/Magento/Eav/Model/Resource/Entity/Attribute/SetTest.php b/dev/tests/unit/testsuite/Magento/Eav/Model/Resource/Entity/Attribute/SetTest.php index a0bb1faf46515..307aa0e72079a 100644 --- a/dev/tests/unit/testsuite/Magento/Eav/Model/Resource/Entity/Attribute/SetTest.php +++ b/dev/tests/unit/testsuite/Magento/Eav/Model/Resource/Entity/Attribute/SetTest.php @@ -29,14 +29,48 @@ class SetTest extends \PHPUnit_Framework_TestCase */ protected $typeMock; + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $transactionManagerMock; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $resourceMock; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $relationProcessor; + protected function setUp() { + $this->resourceMock = $this->getMock('\Magento\Framework\App\Resource', ['getConnection'], [], '', false); + $this->transactionManagerMock = $this->getMock( + '\Magento\Framework\Model\Resource\Db\TransactionManagerInterface' + ); + $this->relationProcessor = $this->getMock( + '\Magento\Framework\Model\Resource\Db\ObjectRelationProcessor', + [], + [], + '', + false + ); + $contextMock = $this->getMock('Magento\Framework\Model\Resource\Db\Context', [], [], '', false); + $contextMock->expects($this->once()) + ->method('getTransactionManager') + ->willReturn($this->transactionManagerMock); + $contextMock->expects($this->once()) + ->method('getObjectRelationProcessor') + ->willReturn($this->relationProcessor); + $contextMock->expects($this->once())->method('getResources')->willReturn($this->resourceMock); + $this->eavConfigMock = $this->getMock('Magento\Eav\Model\Config', [], [], '', false); $this->model = $this->getMock( 'Magento\Eav\Model\Resource\Entity\Attribute\Set', [ 'beginTransaction', - '_getWriteAdapter', 'getMainTable', 'getIdFieldName', '_afterDelete', @@ -45,7 +79,7 @@ protected function setUp() '__wakeup' ], [ - $this->getMock('Magento\Framework\App\Resource', [], [], '', false), + $contextMock, $this->getMock('Magento\Eav\Model\Resource\Entity\Attribute\GroupFactory', [], [], '', false), $this->eavConfigMock ], @@ -78,6 +112,15 @@ protected function setUp() */ public function testBeforeDeleteStateException() { + $this->resourceMock->expects($this->once()) + ->method('getConnection') + ->willReturn($this->getMock('\Magento\Framework\DB\Adapter\AdapterInterface')); + + $this->transactionManagerMock->expects($this->once()) + ->method('start') + ->with($this->getMock('\Magento\Framework\DB\Adapter\AdapterInterface')) + ->willReturn($this->getMock('\Magento\Framework\DB\Adapter\AdapterInterface')); + $this->objectMock->expects($this->once())->method('getEntityTypeId')->willReturn(665); $this->eavConfigMock->expects($this->once())->method('getEntityType')->with(665)->willReturn($this->typeMock); $this->typeMock->expects($this->once())->method('getDefaultAttributeSetId')->willReturn(4); @@ -92,12 +135,21 @@ public function testBeforeDeleteStateException() */ public function testBeforeDelete() { + $this->resourceMock->expects($this->once()) + ->method('getConnection') + ->willReturn($this->getMock('\Magento\Framework\DB\Adapter\AdapterInterface')); + + $this->transactionManagerMock->expects($this->once()) + ->method('start') + ->with($this->getMock('\Magento\Framework\DB\Adapter\AdapterInterface')) + ->willReturn($this->getMock('\Magento\Framework\DB\Adapter\AdapterInterface')); + $this->objectMock->expects($this->once())->method('getEntityTypeId')->willReturn(665); $this->eavConfigMock->expects($this->once())->method('getEntityType')->with(665)->willReturn($this->typeMock); $this->typeMock->expects($this->once())->method('getDefaultAttributeSetId')->willReturn(4); $this->objectMock->expects($this->once())->method('getAttributeSetId')->willReturn(5); - $this->model->expects($this->once()) - ->method('_getWriteAdapter') + $this->relationProcessor->expects($this->once()) + ->method('delete') ->willThrowException(new \Exception('test exception')); $this->model->delete($this->objectMock); diff --git a/dev/tests/unit/testsuite/Magento/Eav/Model/Resource/Entity/AttributeTest.php b/dev/tests/unit/testsuite/Magento/Eav/Model/Resource/Entity/AttributeTest.php index 1b18f8abfaffc..a18969df295ae 100644 --- a/dev/tests/unit/testsuite/Magento/Eav/Model/Resource/Entity/AttributeTest.php +++ b/dev/tests/unit/testsuite/Magento/Eav/Model/Resource/Entity/AttributeTest.php @@ -271,8 +271,21 @@ protected function _prepareResourceModel() $resource->expects($this->any())->method('getTableName')->will($this->returnArgument(0)); $resource->expects($this->any())->method('getConnection')->with()->will($this->returnValue($adapter)); $eavEntityType = $this->getMock('Magento\Eav\Model\Resource\Entity\Type', [], [], '', false, false); + + $relationProcessorMock = $this->getMock( + '\Magento\Framework\Model\Resource\Db\ObjectRelationProcessor', + [], + [], + '', + false + ); + + $contextMock = $this->getMock('\Magento\Framework\Model\Resource\Db\Context', [], [], '', false); + $contextMock->expects($this->once())->method('getResources')->willReturn($resource); + $contextMock->expects($this->once())->method('getObjectRelationProcessor')->willReturn($relationProcessorMock); + $arguments = [ - 'resource' => $resource, + 'context' => $contextMock, 'storeManager' => $storeManager, 'eavEntityType' => $eavEntityType, ]; diff --git a/dev/tests/unit/testsuite/Magento/Framework/FlagTest.php b/dev/tests/unit/testsuite/Magento/Framework/FlagTest.php index 57502b881da8f..3f8fac3ba396b 100644 --- a/dev/tests/unit/testsuite/Magento/Framework/FlagTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/FlagTest.php @@ -48,10 +48,15 @@ protected function createInstance(array $data = []) ->method('getConnection') ->will($this->returnValue($adapter)); - $resource = $this->getMockBuilder('Magento\Framework\Flag\Resource') - ->setMethods(['__wakeup', 'load', 'save', 'addCommitCallback', 'commit', 'rollBack']) - ->setConstructorArgs(['resource' => $appResource]) - ->getMockForAbstractClass(); + $dbContextMock = $this->getMock('\Magento\Framework\Model\Resource\Db\Context', [], [], '', false); + $dbContextMock->expects($this->once())->method('getResources')->willReturn($appResource); + $resource = $this->getMock( + '\Magento\Framework\Flag\Resource', + ['__wakeup', 'load', 'save', 'addCommitCallback', 'commit', 'rollBack'], + ['context' => $dbContextMock], + '', + true + ); $resource->expects($this->any()) ->method('addCommitCallback') ->will($this->returnSelf()); diff --git a/dev/tests/unit/testsuite/Magento/Framework/Model/Resource/Db/AbstractDbTest.php b/dev/tests/unit/testsuite/Magento/Framework/Model/Resource/Db/AbstractDbTest.php index f7c3c49ea5e68..8f46a36a2b681 100644 --- a/dev/tests/unit/testsuite/Magento/Framework/Model/Resource/Db/AbstractDbTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/Model/Resource/Db/AbstractDbTest.php @@ -20,6 +20,16 @@ class AbstractDbTest extends \PHPUnit_Framework_TestCase */ protected $_resourcesMock; + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $transactionManagerMock; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $relationProcessorMock; + protected function setUp() { $this->_resourcesMock = $this->getMock( @@ -30,9 +40,28 @@ protected function setUp() false ); + $this->relationProcessorMock = $this->getMock( + '\Magento\Framework\Model\Resource\Db\ObjectRelationProcessor', + [], + [], + '', + false + ); + $this->transactionManagerMock = $this->getMock( + '\Magento\Framework\Model\Resource\Db\TransactionManagerInterface' + ); + $contextMock = $this->getMock('\Magento\Framework\Model\Resource\Db\Context', [], [], '', false); + $contextMock->expects($this->once())->method('getResources')->willReturn($this->_resourcesMock); + $contextMock->expects($this->once()) + ->method('getObjectRelationProcessor') + ->willReturn($this->relationProcessorMock); + $contextMock->expects($this->once()) + ->method('getTransactionManager') + ->willReturn($this->transactionManagerMock); + $this->_model = $this->getMockForAbstractClass( 'Magento\Framework\Model\Resource\Db\AbstractDb', - [$this->_resourcesMock] + [$contextMock] ); } @@ -277,12 +306,32 @@ public function testDelete() false, true, true, - ['__wakeup', 'getId', 'beforeDelete', 'afterDelete', 'afterDeleteCommit'] + ['__wakeup', 'getId', 'beforeDelete', 'afterDelete', 'afterDeleteCommit', 'getData'] ); $this->_resourcesMock->expects($this->any()) ->method('getConnection') ->will($this->returnValue($adapterInterfaceMock) ); + + $abstractModelMock->expects($this->once())->method('getData')->willReturn(['data' => 'value']); + $connectionMock = $this->getMock('\Magento\Framework\DB\Adapter\AdapterInterface'); + $this->transactionManagerMock->expects($this->once()) + ->method('start') + ->with($adapterInterfaceMock) + ->willReturn($connectionMock); + + $this->relationProcessorMock->expects($this->once()) + ->method('delete') + ->with( + $this->transactionManagerMock, + $connectionMock, + 'tableName', + 'idFieldName', + ['data' => 'value'] + ); + + $this->transactionManagerMock->expects($this->once())->method('commit'); + $data = 'tableName'; $this->_resourcesMock->expects($this->any())->method('getTableName')->with($data)->will( $this->returnValue('tableName') diff --git a/dev/tests/unit/testsuite/Magento/Quote/Model/Resource/QuoteTest.php b/dev/tests/unit/testsuite/Magento/Quote/Model/Resource/QuoteTest.php index 4742a456a74db..bd2902942609b 100644 --- a/dev/tests/unit/testsuite/Magento/Quote/Model/Resource/QuoteTest.php +++ b/dev/tests/unit/testsuite/Magento/Quote/Model/Resource/QuoteTest.php @@ -52,8 +52,11 @@ protected function setUp() $this->configMock = $this->getMock('\Magento\Eav\Model\Config', [], [], '', false); + $contextMock = $this->getMock('\Magento\Framework\Model\Resource\Db\Context', [], [], '', false); + $contextMock->expects($this->once())->method('getResources')->willReturn($this->resourceMock); + $this->model = new \Magento\Quote\Model\Resource\Quote( - $this->resourceMock, + $contextMock, $this->configMock ); } diff --git a/dev/tests/unit/testsuite/Magento/Sales/Model/Resource/Order/Creditmemo/CommentTest.php b/dev/tests/unit/testsuite/Magento/Sales/Model/Resource/Order/Creditmemo/CommentTest.php index 4b8374eb61a3d..f02249b125c7a 100644 --- a/dev/tests/unit/testsuite/Magento/Sales/Model/Resource/Order/Creditmemo/CommentTest.php +++ b/dev/tests/unit/testsuite/Magento/Sales/Model/Resource/Order/Creditmemo/CommentTest.php @@ -80,11 +80,24 @@ protected function setUp() ->method('lastInsertId'); $this->commentModelMock->expects($this->any())->method('hasDataChanges')->will($this->returnValue(true)); $this->commentModelMock->expects($this->any())->method('isSaveAllowed')->will($this->returnValue(true)); + + $relationProcessorMock = $this->getMock( + '\Magento\Framework\Model\Resource\Db\ObjectRelationProcessor', + [], + [], + '', + false + ); + + $contextMock = $this->getMock('\Magento\Framework\Model\Resource\Db\Context', [], [], '', false); + $contextMock->expects($this->once())->method('getResources')->willReturn($this->appResourceMock); + $contextMock->expects($this->once())->method('getObjectRelationProcessor')->willReturn($relationProcessorMock); + $objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); $this->commentResource = $objectManager->getObject( 'Magento\Sales\Model\Resource\Order\Creditmemo\Comment', [ - 'resource' => $this->appResourceMock, + 'context' => $contextMock, 'validator' => $this->validatorMock ] ); @@ -99,6 +112,8 @@ public function testSave() ->method('validate') ->with($this->equalTo($this->commentModelMock)) ->will($this->returnValue([])); + + $this->commentModelMock->expects($this->any())->method('getData')->willReturn([]); $this->commentResource->save($this->commentModelMock); $this->assertTrue(true); } diff --git a/dev/tests/unit/testsuite/Magento/Sales/Model/Resource/Order/Creditmemo/GridTest.php b/dev/tests/unit/testsuite/Magento/Sales/Model/Resource/Order/Creditmemo/GridTest.php index 3c7eac389109f..24ffb0c200798 100644 --- a/dev/tests/unit/testsuite/Magento/Sales/Model/Resource/Order/Creditmemo/GridTest.php +++ b/dev/tests/unit/testsuite/Magento/Sales/Model/Resource/Order/Creditmemo/GridTest.php @@ -85,9 +85,10 @@ public function setUp() true, [] ); - $this->grid = new \Magento\Sales\Model\Resource\Order\Creditmemo\Grid( - $this->appResourceMock - ); + + $contextMock = $this->getMock('\Magento\Framework\Model\Resource\Db\Context', [], [], '', false); + $contextMock->expects($this->once())->method('getResources')->willReturn($this->appResourceMock); + $this->grid = new \Magento\Sales\Model\Resource\Order\Creditmemo\Grid($contextMock); } /** diff --git a/dev/tests/unit/testsuite/Magento/Sales/Model/Resource/Order/GridTest.php b/dev/tests/unit/testsuite/Magento/Sales/Model/Resource/Order/GridTest.php index 9b6acb658f5f3..186ad505336a8 100644 --- a/dev/tests/unit/testsuite/Magento/Sales/Model/Resource/Order/GridTest.php +++ b/dev/tests/unit/testsuite/Magento/Sales/Model/Resource/Order/GridTest.php @@ -85,9 +85,10 @@ public function setUp() true, [] ); - $this->grid = new \Magento\Sales\Model\Resource\Order\Grid( - $this->appResourceMock - ); + + $contextMock = $this->getMock('\Magento\Framework\Model\Resource\Db\Context', [], [], '', false); + $contextMock->expects($this->once())->method('getResources')->willReturn($this->appResourceMock); + $this->grid = new \Magento\Sales\Model\Resource\Order\Grid($contextMock); } /** diff --git a/dev/tests/unit/testsuite/Magento/Sales/Model/Resource/Order/Invoice/CommentTest.php b/dev/tests/unit/testsuite/Magento/Sales/Model/Resource/Order/Invoice/CommentTest.php index 4b4e9a32dd640..b9be471e5a641 100644 --- a/dev/tests/unit/testsuite/Magento/Sales/Model/Resource/Order/Invoice/CommentTest.php +++ b/dev/tests/unit/testsuite/Magento/Sales/Model/Resource/Order/Invoice/CommentTest.php @@ -80,11 +80,24 @@ protected function setUp() ->method('lastInsertId'); $this->commentModelMock->expects($this->any())->method('hasDataChanges')->will($this->returnValue(true)); $this->commentModelMock->expects($this->any())->method('isSaveAllowed')->will($this->returnValue(true)); + + $relationProcessorMock = $this->getMock( + '\Magento\Framework\Model\Resource\Db\ObjectRelationProcessor', + [], + [], + '', + false + ); + + $contextMock = $this->getMock('\Magento\Framework\Model\Resource\Db\Context', [], [], '', false); + $contextMock->expects($this->once())->method('getResources')->willReturn($this->appResourceMock); + $contextMock->expects($this->once())->method('getObjectRelationProcessor')->willReturn($relationProcessorMock); + $objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); $this->commentResource = $objectManager->getObject( 'Magento\Sales\Model\Resource\Order\Invoice\Comment', [ - 'resource' => $this->appResourceMock, + 'context' => $contextMock, 'validator' => $this->validatorMock ] ); @@ -99,6 +112,7 @@ public function testSave() ->method('validate') ->with($this->equalTo($this->commentModelMock)) ->will($this->returnValue([])); + $this->commentModelMock->expects($this->any())->method('getData')->willReturn([]); $this->commentResource->save($this->commentModelMock); $this->assertTrue(true); } diff --git a/dev/tests/unit/testsuite/Magento/Sales/Model/Resource/Order/Invoice/GridTest.php b/dev/tests/unit/testsuite/Magento/Sales/Model/Resource/Order/Invoice/GridTest.php index a8e1fce776d15..481c0ad8f8778 100644 --- a/dev/tests/unit/testsuite/Magento/Sales/Model/Resource/Order/Invoice/GridTest.php +++ b/dev/tests/unit/testsuite/Magento/Sales/Model/Resource/Order/Invoice/GridTest.php @@ -85,9 +85,9 @@ public function setUp() true, [] ); - $this->grid = new \Magento\Sales\Model\Resource\Order\Invoice\Grid( - $this->appResourceMock - ); + $contextMock = $this->getMock('\Magento\Framework\Model\Resource\Db\Context', [], [], '', false); + $contextMock->expects($this->once())->method('getResources')->willReturn($this->appResourceMock); + $this->grid = new \Magento\Sales\Model\Resource\Order\Invoice\Grid($contextMock); } /** diff --git a/dev/tests/unit/testsuite/Magento/Sales/Model/Resource/Order/Shipment/CommentTest.php b/dev/tests/unit/testsuite/Magento/Sales/Model/Resource/Order/Shipment/CommentTest.php index 0751671766912..28e561af1efbe 100644 --- a/dev/tests/unit/testsuite/Magento/Sales/Model/Resource/Order/Shipment/CommentTest.php +++ b/dev/tests/unit/testsuite/Magento/Sales/Model/Resource/Order/Shipment/CommentTest.php @@ -80,11 +80,24 @@ protected function setUp() ->method('lastInsertId'); $this->commentModelMock->expects($this->any())->method('hasDataChanges')->will($this->returnValue(true)); $this->commentModelMock->expects($this->any())->method('isSaveAllowed')->will($this->returnValue(true)); + + $relationProcessorMock = $this->getMock( + '\Magento\Framework\Model\Resource\Db\ObjectRelationProcessor', + [], + [], + '', + false + ); + + $contextMock = $this->getMock('\Magento\Framework\Model\Resource\Db\Context', [], [], '', false); + $contextMock->expects($this->once())->method('getResources')->willReturn($this->appResourceMock); + $contextMock->expects($this->once())->method('getObjectRelationProcessor')->willReturn($relationProcessorMock); + $objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); $this->commentResource = $objectManager->getObject( 'Magento\Sales\Model\Resource\Order\Shipment\Comment', [ - 'resource' => $this->appResourceMock, + 'context' => $contextMock, 'validator' => $this->validatorMock ] ); @@ -99,6 +112,7 @@ public function testSave() ->method('validate') ->with($this->equalTo($this->commentModelMock)) ->will($this->returnValue([])); + $this->commentModelMock->expects($this->any())->method('getData')->willReturn([]); $this->commentResource->save($this->commentModelMock); $this->assertTrue(true); } diff --git a/dev/tests/unit/testsuite/Magento/Sales/Model/Resource/Order/Shipment/GridTest.php b/dev/tests/unit/testsuite/Magento/Sales/Model/Resource/Order/Shipment/GridTest.php index f737ca3604c72..c0c2b7d0f1705 100644 --- a/dev/tests/unit/testsuite/Magento/Sales/Model/Resource/Order/Shipment/GridTest.php +++ b/dev/tests/unit/testsuite/Magento/Sales/Model/Resource/Order/Shipment/GridTest.php @@ -85,9 +85,9 @@ public function setUp() true, [] ); - $this->grid = new \Magento\Sales\Model\Resource\Order\Shipment\Grid( - $this->appResourceMock - ); + $contextMock = $this->getMock('\Magento\Framework\Model\Resource\Db\Context', [], [], '', false); + $contextMock->expects($this->once())->method('getResources')->willReturn($this->appResourceMock); + $this->grid = new \Magento\Sales\Model\Resource\Order\Shipment\Grid($contextMock); } /** diff --git a/dev/tests/unit/testsuite/Magento/Sales/Model/Resource/Order/Shipment/TrackTest.php b/dev/tests/unit/testsuite/Magento/Sales/Model/Resource/Order/Shipment/TrackTest.php index 1e3b756811839..6aece38bed27c 100644 --- a/dev/tests/unit/testsuite/Magento/Sales/Model/Resource/Order/Shipment/TrackTest.php +++ b/dev/tests/unit/testsuite/Magento/Sales/Model/Resource/Order/Shipment/TrackTest.php @@ -81,11 +81,23 @@ protected function setUp() $this->trackModelMock->expects($this->any())->method('hasDataChanges')->will($this->returnValue(true)); $this->trackModelMock->expects($this->any())->method('isSaveAllowed')->will($this->returnValue(true)); + $relationProcessorMock = $this->getMock( + '\Magento\Framework\Model\Resource\Db\ObjectRelationProcessor', + [], + [], + '', + false + ); + + $contextMock = $this->getMock('\Magento\Framework\Model\Resource\Db\Context', [], [], '', false); + $contextMock->expects($this->once())->method('getResources')->willReturn($this->appResourceMock); + $contextMock->expects($this->once())->method('getObjectRelationProcessor')->willReturn($relationProcessorMock); + $objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); $this->trackResource = $objectManager->getObject( 'Magento\Sales\Model\Resource\Order\Shipment\Track', [ - 'resource' => $this->appResourceMock, + 'context' => $contextMock, 'validator' => $this->validatorMock ] ); @@ -100,6 +112,7 @@ public function testSave() ->method('validate') ->with($this->equalTo($this->trackModelMock)) ->will($this->returnValue([])); + $this->trackModelMock->expects($this->any())->method('getData')->willReturn([]); $this->trackResource->save($this->trackModelMock); $this->assertTrue(true); } @@ -116,6 +129,7 @@ public function testSaveValidationFailed() ->method('validate') ->with($this->equalTo($this->trackModelMock)) ->will($this->returnValue(['warning message'])); + $this->trackModelMock->expects($this->any())->method('getData')->willReturn([]); $this->trackResource->save($this->trackModelMock); $this->assertTrue(true); } diff --git a/dev/tests/unit/testsuite/Magento/Sales/Model/Resource/Order/Status/HistoryTest.php b/dev/tests/unit/testsuite/Magento/Sales/Model/Resource/Order/Status/HistoryTest.php index acdb1d12f244e..a8b774b649d50 100644 --- a/dev/tests/unit/testsuite/Magento/Sales/Model/Resource/Order/Status/HistoryTest.php +++ b/dev/tests/unit/testsuite/Magento/Sales/Model/Resource/Order/Status/HistoryTest.php @@ -70,10 +70,23 @@ public function setUp() ->method('insert'); $this->adapterMock->expects($this->any()) ->method('lastInsertId'); + + $relationProcessorMock = $this->getMock( + '\Magento\Framework\Model\Resource\Db\ObjectRelationProcessor', + [], + [], + '', + false + ); + + $contextMock = $this->getMock('\Magento\Framework\Model\Resource\Db\Context', [], [], '', false); + $contextMock->expects($this->once())->method('getResources')->willReturn($this->appResourceMock); + $contextMock->expects($this->once())->method('getObjectRelationProcessor')->willReturn($relationProcessorMock); + $this->historyResource = $objectManager->getObject( 'Magento\Sales\Model\Resource\Order\Status\History', [ - 'resource' => $this->appResourceMock, + 'context' => $contextMock, 'validator' => $this->validatorMock ] ); @@ -97,6 +110,7 @@ public function testSave() ->method('validate') ->with($historyMock) ->will($this->returnValue([])); + $historyMock->expects($this->any())->method('getData')->willReturn([]); $this->historyResource->save($historyMock); } diff --git a/dev/tests/unit/testsuite/Magento/Sales/Model/Resource/OrderTest.php b/dev/tests/unit/testsuite/Magento/Sales/Model/Resource/OrderTest.php index 9059eeced38ad..69eeb3401d260 100644 --- a/dev/tests/unit/testsuite/Magento/Sales/Model/Resource/OrderTest.php +++ b/dev/tests/unit/testsuite/Magento/Sales/Model/Resource/OrderTest.php @@ -144,8 +144,11 @@ public function setUp() false ); + $contextMock = $this->getMock('\Magento\Framework\Model\Resource\Db\Context', [], [], '', false); + $contextMock->expects($this->once())->method('getResources')->willReturn($this->resourceMock); + $this->resource = new Order( - $this->resourceMock, + $contextMock, $this->attributeMock, $this->salesIncrementMock, $this->addressHandlerMock, diff --git a/dev/tests/unit/testsuite/Magento/Weee/Model/Resource/Attribute/Backend/Weee/TaxTest.php b/dev/tests/unit/testsuite/Magento/Weee/Model/Resource/Attribute/Backend/Weee/TaxTest.php index 28b5a759954ca..09aa868e82282 100644 --- a/dev/tests/unit/testsuite/Magento/Weee/Model/Resource/Attribute/Backend/Weee/TaxTest.php +++ b/dev/tests/unit/testsuite/Magento/Weee/Model/Resource/Attribute/Backend/Weee/TaxTest.php @@ -42,8 +42,11 @@ protected function setUp() ->method('getTableName') ->willReturn('table_name'); + $contextMock = $this->getMock('\Magento\Framework\Model\Resource\Db\Context', [], [], '', false); + $contextMock->expects($this->once())->method('getResources')->willReturn($this->resourceMock); + $this->model = new \Magento\Weee\Model\Resource\Attribute\Backend\Weee\Tax( - $this->resourceMock, + $contextMock, $this->storeManagerMock ); } From 87ca833b5bf23e90f89807c16bcfa0988b1c93f3 Mon Sep 17 00:00:00 2001 From: Stanislav Idolov Date: Tue, 10 Feb 2015 16:54:42 +0200 Subject: [PATCH 26/44] MAGETWO-33783: Unit tests coverage --- .../Resource/Import/CustomerComposite/DataTest.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/dev/tests/unit/testsuite/Magento/CustomerImportExport/Model/Resource/Import/CustomerComposite/DataTest.php b/dev/tests/unit/testsuite/Magento/CustomerImportExport/Model/Resource/Import/CustomerComposite/DataTest.php index dd1d9e6b47d3e..c3e1132382a51 100644 --- a/dev/tests/unit/testsuite/Magento/CustomerImportExport/Model/Resource/Import/CustomerComposite/DataTest.php +++ b/dev/tests/unit/testsuite/Magento/CustomerImportExport/Model/Resource/Import/CustomerComposite/DataTest.php @@ -102,11 +102,16 @@ public function testGetNextBunch($entityType, $bunchData, $expectedData) $contextMock = $this->getMock('\Magento\Framework\Model\Resource\Db\Context', [], [], '', false); $contextMock->expects($this->once())->method('getResources')->willReturn($resource); - $object = new Data( - $contextMock, - $coreHelper, - $dependencies + $objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); + $object = $objectManager->getObject( + '\Magento\CustomerImportExport\Model\Resource\Import\CustomerComposite\Data', + [ + 'context' => $contextMock, + 'coreHelper' => $coreHelper, + 'arguments' => $dependencies, + ] ); + $this->assertEquals($expectedData, $object->getNextBunch()); } From c901e8f5a8220d1bfc749707d042a278eaef7df4 Mon Sep 17 00:00:00 2001 From: Stanislav Idolov Date: Tue, 10 Feb 2015 17:25:05 +0200 Subject: [PATCH 27/44] MAGETWO-33783: Unit tests coverage --- .../Magento/Setup/Module/SetupFactoryTest.php | 8 +++++++ .../Magento/Setup/Module/SetupModuleTest.php | 24 +++++++++++++++---- 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/dev/tests/unit/testsuite/Magento/Setup/Module/SetupFactoryTest.php b/dev/tests/unit/testsuite/Magento/Setup/Module/SetupFactoryTest.php index 4c5ca898699ad..7ecc25c8573f8 100644 --- a/dev/tests/unit/testsuite/Magento/Setup/Module/SetupFactoryTest.php +++ b/dev/tests/unit/testsuite/Magento/Setup/Module/SetupFactoryTest.php @@ -28,6 +28,14 @@ protected function setUp() 'Magento\Framework\App\DeploymentConfig\Reader', $this->getMock('Magento\Framework\App\DeploymentConfig\Reader', [], [], '', false), ], + [ + 'Magento\Framework\Model\Resource\Db\TransactionManager', + $this->getMock('Magento\Framework\Model\Resource\Db\TransactionManager', [], [], '', false), + ], + [ + 'Magento\Framework\Model\Resource\Db\ObjectRelationProcessor', + $this->getMock('Magento\Framework\Model\Resource\Db\ObjectRelationProcessor', [], [], '', false), + ], ]; $serviceLocatorMock = $this->getMockForAbstractClass('Zend\ServiceManager\ServiceLocatorInterface', ['get']); diff --git a/dev/tests/unit/testsuite/Magento/Setup/Module/SetupModuleTest.php b/dev/tests/unit/testsuite/Magento/Setup/Module/SetupModuleTest.php index 75fabe08645a2..675ee17fc4c8d 100644 --- a/dev/tests/unit/testsuite/Magento/Setup/Module/SetupModuleTest.php +++ b/dev/tests/unit/testsuite/Magento/Setup/Module/SetupModuleTest.php @@ -54,12 +54,16 @@ public function testApplyRecurringUpdatesWithValidFile() $this->loggerMock ->expects($this->once()) ->method('log'); + + $contextMock = $this->getMock('\Magento\Framework\Model\Resource\Db\Context', [], [], '', false); + $contextMock->expects($this->any())->method('getResources')->willReturn($this->resourceModelMock); + $setupModule = new SetupModule( $this->loggerMock, $this->moduleListMock, $fileResolver, $this->moduleName, - $this->resourceModelMock + $contextMock ); $setupModule = $setupModule->applyRecurringUpdates(); $this->assertInstanceOf('Magento\Setup\Module\SetupModule', $setupModule); @@ -80,12 +84,16 @@ public function testApplyRecurringUpdatesWithInvalidFile() $this->loggerMock ->expects($this->once()) ->method('log'); + + $contextMock = $this->getMock('\Magento\Framework\Model\Resource\Db\Context', [], [], '', false); + $contextMock->expects($this->any())->method('getResources')->willReturn($this->resourceModelMock); + $setupModule = new SetupModule( $this->loggerMock, $this->moduleListMock, $fileResolver, $this->moduleName, - $this->resourceModelMock + $contextMock ); $setupModule->applyRecurringUpdates(); } @@ -97,12 +105,16 @@ public function testApplyUpdatesWithNullResource() ->expects($this->once()) ->method('getResourceCode') ->will($this->returnValue(null)); + + $contextMock = $this->getMock('\Magento\Framework\Model\Resource\Db\Context', [], [], '', false); + $contextMock->expects($this->any())->method('getResources')->willReturn($this->resourceModelMock); + $setupModule = new SetupModule( $this->loggerMock, $this->moduleListMock, $fileResolver, $this->moduleName, - $this->resourceModelMock + $contextMock ); $setupModule = $setupModule->applyUpdates(); $this->assertInstanceOf('Magento\Setup\Module\SetupModule', $setupModule); @@ -111,12 +123,16 @@ public function testApplyUpdatesWithNullResource() public function testApplyUpdatesWithNoVersions() { $fileResolver = $this->getMock('Magento\Setup\Module\Setup\FileResolver', [], [], '', false); + + $contextMock = $this->getMock('\Magento\Framework\Model\Resource\Db\Context', [], [], '', false); + $contextMock->expects($this->any())->method('getResources')->willReturn($this->resourceModelMock); + $setupModule = new SetupModule( $this->loggerMock, $this->moduleListMock, $fileResolver, $this->moduleName, - $this->resourceModelMock + $contextMock ); $setupModule = $setupModule->applyUpdates(); $this->assertInstanceOf('Magento\Setup\Module\SetupModule', $setupModule); From 51d7214dc2acfb566142a8520d0bdfff1c3dd118 Mon Sep 17 00:00:00 2001 From: Iryna Lagno Date: Tue, 10 Feb 2015 17:53:58 +0200 Subject: [PATCH 28/44] MAGETWO-32974: DB Foreign Keys Management on the Application Level --- app/code/Magento/Quote/etc/resources.xml | 12 ------------ 1 file changed, 12 deletions(-) delete mode 100644 app/code/Magento/Quote/etc/resources.xml diff --git a/app/code/Magento/Quote/etc/resources.xml b/app/code/Magento/Quote/etc/resources.xml deleted file mode 100644 index 9db2e0bbfd1e7..0000000000000 --- a/app/code/Magento/Quote/etc/resources.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - From 3003a86f28dc17146e4ee0b7b1f1d61fe3b74b83 Mon Sep 17 00:00:00 2001 From: Iryna Lagno Date: Tue, 10 Feb 2015 18:09:22 +0200 Subject: [PATCH 29/44] MAGETWO-32974: DB Foreign Keys Management on the Application Level --- app/code/Magento/Sales/Model/Resource/Order/Invoice.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/Sales/Model/Resource/Order/Invoice.php b/app/code/Magento/Sales/Model/Resource/Order/Invoice.php index c96434521afb9..1a9f61d4020eb 100644 --- a/app/code/Magento/Sales/Model/Resource/Order/Invoice.php +++ b/app/code/Magento/Sales/Model/Resource/Order/Invoice.php @@ -45,10 +45,10 @@ public function __construct( \Magento\Framework\Model\Resource\Db\Context $context, Attribute $attribute, SalesIncrement $salesIncrement, - InvoiceGrid $gridAggregator, - $resourcePrefix = null + $resourcePrefix = null, + InvoiceGrid $gridAggregator ) { - parent::__construct($context, $attribute, $salesIncrement, $gridAggregator, $resourcePrefix); + parent::__construct($context, $attribute, $salesIncrement, $resourcePrefix, $gridAggregator); } /** From 808bf6ae69af0d1451098f2873d1c7fc60189b90 Mon Sep 17 00:00:00 2001 From: Iryna Lagno Date: Wed, 11 Feb 2015 12:43:08 +0200 Subject: [PATCH 30/44] MAGETWO-34012:There is no ability to place order from backend --- app/code/Magento/Sales/Model/Resource/Order/Creditmemo.php | 2 +- app/code/Magento/Sales/Model/Resource/Order/Invoice.php | 4 ++-- app/code/Magento/Sales/Model/Resource/Order/Shipment.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/Sales/Model/Resource/Order/Creditmemo.php b/app/code/Magento/Sales/Model/Resource/Order/Creditmemo.php index 2c9d4a35f5196..11123a7771cc0 100644 --- a/app/code/Magento/Sales/Model/Resource/Order/Creditmemo.php +++ b/app/code/Magento/Sales/Model/Resource/Order/Creditmemo.php @@ -52,7 +52,7 @@ public function __construct( CreditmemoGrid $gridAggregator, $resourcePrefix = null ) { - parent::__construct($context, $attribute, $salesIncrement, $gridAggregator, $resourcePrefix); + parent::__construct($context, $attribute, $salesIncrement, $resourcePrefix, $gridAggregator); } /** diff --git a/app/code/Magento/Sales/Model/Resource/Order/Invoice.php b/app/code/Magento/Sales/Model/Resource/Order/Invoice.php index 1a9f61d4020eb..79317bda2843a 100644 --- a/app/code/Magento/Sales/Model/Resource/Order/Invoice.php +++ b/app/code/Magento/Sales/Model/Resource/Order/Invoice.php @@ -45,8 +45,8 @@ public function __construct( \Magento\Framework\Model\Resource\Db\Context $context, Attribute $attribute, SalesIncrement $salesIncrement, - $resourcePrefix = null, - InvoiceGrid $gridAggregator + InvoiceGrid $gridAggregator, + $resourcePrefix = null ) { parent::__construct($context, $attribute, $salesIncrement, $resourcePrefix, $gridAggregator); } diff --git a/app/code/Magento/Sales/Model/Resource/Order/Shipment.php b/app/code/Magento/Sales/Model/Resource/Order/Shipment.php index d1fce7c500d48..d2ef3ae32e63a 100644 --- a/app/code/Magento/Sales/Model/Resource/Order/Shipment.php +++ b/app/code/Magento/Sales/Model/Resource/Order/Shipment.php @@ -57,7 +57,7 @@ public function __construct( ShipmentGrid $gridAggregator, $resourcePrefix = null ) { - parent::__construct($context, $attribute, $salesIncrement, $gridAggregator, $resourcePrefix); + parent::__construct($context, $attribute, $salesIncrement, $resourcePrefix, $gridAggregator); } /** From 3d763433bc567bfe4f19ab18ec1173cd27188fc5 Mon Sep 17 00:00:00 2001 From: Olexii Korshenko Date: Thu, 12 Feb 2015 12:48:39 +0200 Subject: [PATCH 31/44] MAGETWO-32974: DB Foreign Keys Management on the Application Level - fixed connection names configuration injection --- app/etc/di.xml | 2 +- lib/internal/Magento/Framework/App/Resource/Config.php | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/etc/di.xml b/app/etc/di.xml index c2b3e5e959b53..4f21362c8e3bc 100644 --- a/app/etc/di.xml +++ b/app/etc/di.xml @@ -250,7 +250,7 @@ Magento\Framework\App\Resource\Config\Reader\Proxy Magento\Framework\App\Cache\Type\Config\Proxy - Magento\Framework\App\Resource\Config::PARAM_INITIAL_RESOURCES + Magento\Framework\App\DeploymentConfig\ResourceConfig diff --git a/lib/internal/Magento/Framework/App/Resource/Config.php b/lib/internal/Magento/Framework/App/Resource/Config.php index edd93993a2849..c2cf0351afa88 100644 --- a/lib/internal/Magento/Framework/App/Resource/Config.php +++ b/lib/internal/Magento/Framework/App/Resource/Config.php @@ -24,19 +24,19 @@ class Config extends \Magento\Framework\Config\Data\Scoped implements ConfigInte * @param Config\Reader $reader * @param \Magento\Framework\Config\ScopeInterface $configScope * @param \Magento\Framework\Config\CacheInterface $cache + * @param \Magento\Framework\App\DeploymentConfig $deploymentConfig * @param string $cacheId - * @param array $initialResources * @throws \InvalidArgumentException */ public function __construct( Config\Reader $reader, \Magento\Framework\Config\ScopeInterface $configScope, \Magento\Framework\Config\CacheInterface $cache, - $cacheId = 'resourcesCache', - $initialResources = [] + \Magento\Framework\App\DeploymentConfig $deploymentConfig, + $cacheId = 'resourcesCache' ) { parent::__construct($reader, $configScope, $cache, $cacheId); - foreach ($initialResources as $resourceName => $resourceData) { + foreach ($deploymentConfig->getSegment('resource') as $resourceName => $resourceData) { if (!isset($resourceData['connection'])) { throw new \InvalidArgumentException('Invalid initial resource configuration'); } From 77b729df2a797fce0aaf1af6ea09394376f7d510 Mon Sep 17 00:00:00 2001 From: Olexii Korshenko Date: Thu, 12 Feb 2015 15:18:27 +0200 Subject: [PATCH 32/44] MAGETWO-32974: DB Foreign Keys Management on the Application Level --- lib/internal/Magento/Framework/App/Resource.php | 11 +++++++++++ .../Magento/Framework/App/Resource/Config.php | 1 + 2 files changed, 12 insertions(+) diff --git a/lib/internal/Magento/Framework/App/Resource.php b/lib/internal/Magento/Framework/App/Resource.php index 631dec1a33e7a..518f642c31680 100644 --- a/lib/internal/Magento/Framework/App/Resource.php +++ b/lib/internal/Magento/Framework/App/Resource.php @@ -90,6 +90,17 @@ public function __construct( public function getConnection($resourceName) { $connectionName = $this->_config->getConnectionName($resourceName); + return $this->getConnectionByName($connectionName); + } + + /** + * Retrieve connection by $connectionName + * + * @param string $connectionName + * @return bool|\Magento\Framework\DB\Adapter\AdapterInterface + */ + public function getConnectionByName($connectionName) + { if (isset($this->_connections[$connectionName])) { return $this->_connections[$connectionName]; } diff --git a/lib/internal/Magento/Framework/App/Resource/Config.php b/lib/internal/Magento/Framework/App/Resource/Config.php index c2cf0351afa88..381ad3e718605 100644 --- a/lib/internal/Magento/Framework/App/Resource/Config.php +++ b/lib/internal/Magento/Framework/App/Resource/Config.php @@ -64,6 +64,7 @@ public function getConnectionName($resourceName) break; } elseif (isset($this->_connectionNames[$pointerResourceName])) { $this->_connectionNames[$resourceName] = $this->_connectionNames[$pointerResourceName]; + $connectionName = $this->_connectionNames[$resourceName]; break; } elseif (isset($resourcesConfig[$pointerResourceName]['extends'])) { $pointerResourceName = $resourcesConfig[$pointerResourceName]['extends']; From b46c7d0afc53a0ff2ff3fa07e1748687e35176fe Mon Sep 17 00:00:00 2001 From: Olexii Korshenko Date: Thu, 12 Feb 2015 18:00:06 +0200 Subject: [PATCH 33/44] MAGETWO-32974: DB Foreign Keys Management on the Application Level - implemented logic for EAV models --- .../Model/Resource/AbstractResource.php | 26 +--- .../Catalog/Model/Resource/Category.php | 29 +--- .../Catalog/Model/Resource/Product.php | 21 +-- .../Customer/Model/Resource/Address.php | 24 +-- .../Customer/Model/Resource/Customer.php | 25 +-- app/code/Magento/Eav/Model/Entity.php | 30 +--- .../Eav/Model/Entity/AbstractEntity.php | 61 ++++---- app/code/Magento/Eav/Model/Entity/Context.php | 144 ++++++++++++++++++ 8 files changed, 200 insertions(+), 160 deletions(-) create mode 100644 app/code/Magento/Eav/Model/Entity/Context.php diff --git a/app/code/Magento/Catalog/Model/Resource/AbstractResource.php b/app/code/Magento/Catalog/Model/Resource/AbstractResource.php index adfda93a7c98e..f84fc670d45b8 100644 --- a/app/code/Magento/Catalog/Model/Resource/AbstractResource.php +++ b/app/code/Magento/Catalog/Model/Resource/AbstractResource.php @@ -38,40 +38,20 @@ abstract class AbstractResource extends \Magento\Eav\Model\Entity\AbstractEntity protected $_modelFactory; /** - * Construct - * - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Eav\Model\Config $eavConfig - * @param \Magento\Eav\Model\Entity\Attribute\Set $attrSetEntity - * @param \Magento\Framework\Locale\FormatInterface $localeFormat - * @param \Magento\Eav\Model\Resource\Helper $resourceHelper - * @param \Magento\Framework\Validator\UniversalFactory $universalFactory + * @param \Magento\Eav\Model\Entity\Context $context * @param \Magento\Framework\Store\StoreManagerInterface $storeManager * @param \Magento\Catalog\Model\Factory $modelFactory * @param array $data */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Eav\Model\Config $eavConfig, - \Magento\Eav\Model\Entity\Attribute\Set $attrSetEntity, - \Magento\Framework\Locale\FormatInterface $localeFormat, - \Magento\Eav\Model\Resource\Helper $resourceHelper, - \Magento\Framework\Validator\UniversalFactory $universalFactory, + \Magento\Eav\Model\Entity\Context $context, \Magento\Framework\Store\StoreManagerInterface $storeManager, \Magento\Catalog\Model\Factory $modelFactory, $data = [] ) { $this->_storeManager = $storeManager; $this->_modelFactory = $modelFactory; - parent::__construct( - $resource, - $eavConfig, - $attrSetEntity, - $localeFormat, - $resourceHelper, - $universalFactory, - $data - ); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Catalog/Model/Resource/Category.php b/app/code/Magento/Catalog/Model/Resource/Category.php index 19eb4ee65f49c..50f4d2c007634 100644 --- a/app/code/Magento/Catalog/Model/Resource/Category.php +++ b/app/code/Magento/Catalog/Model/Resource/Category.php @@ -66,30 +66,16 @@ class Category extends AbstractResource protected $_categoryTreeFactory; /** - * Construct - * - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Eav\Model\Config $eavConfig - * @param \Magento\Eav\Model\Entity\Attribute\Set $attrSetEntity - * @param \Magento\Framework\Locale\FormatInterface $localeFormat - * @param \Magento\Eav\Model\Resource\Helper $resourceHelper - * @param \Magento\Framework\Validator\UniversalFactory $universalFactory + * @param \Magento\Eav\Model\Entity\Context $context * @param \Magento\Framework\Store\StoreManagerInterface $storeManager * @param \Magento\Catalog\Model\Factory $modelFactory * @param \Magento\Framework\Event\ManagerInterface $eventManager - * @param \Magento\Catalog\Model\Resource\Category\TreeFactory $categoryTreeFactory - * @param \Magento\Catalog\Model\Resource\Category\CollectionFactory $categoryCollectionFactory + * @param Category\TreeFactory $categoryTreeFactory + * @param Category\CollectionFactory $categoryCollectionFactory * @param array $data - * - * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Eav\Model\Config $eavConfig, - \Magento\Eav\Model\Entity\Attribute\Set $attrSetEntity, - \Magento\Framework\Locale\FormatInterface $localeFormat, - \Magento\Eav\Model\Resource\Helper $resourceHelper, - \Magento\Framework\Validator\UniversalFactory $universalFactory, + \Magento\Eav\Model\Entity\Context $context, \Magento\Framework\Store\StoreManagerInterface $storeManager, \Magento\Catalog\Model\Factory $modelFactory, \Magento\Framework\Event\ManagerInterface $eventManager, @@ -98,12 +84,7 @@ public function __construct( $data = [] ) { parent::__construct( - $resource, - $eavConfig, - $attrSetEntity, - $localeFormat, - $resourceHelper, - $universalFactory, + $context, $storeManager, $modelFactory, $data diff --git a/app/code/Magento/Catalog/Model/Resource/Product.php b/app/code/Magento/Catalog/Model/Resource/Product.php index abfa6e7998c71..3d00341b824be 100644 --- a/app/code/Magento/Catalog/Model/Resource/Product.php +++ b/app/code/Magento/Catalog/Model/Resource/Product.php @@ -57,12 +57,7 @@ class Product extends AbstractResource protected $typeFactory; /** - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Eav\Model\Config $eavConfig - * @param \Magento\Eav\Model\Entity\Attribute\Set $attrSetEntity - * @param \Magento\Framework\Locale\FormatInterface $localeFormat - * @param \Magento\Eav\Model\Resource\Helper $resourceHelper - * @param \Magento\Framework\Validator\UniversalFactory $universalFactory + * @param \Magento\Eav\Model\Entity\Context $context * @param \Magento\Framework\Store\StoreManagerInterface $storeManager * @param \Magento\Catalog\Model\Factory $modelFactory * @param Category\CollectionFactory $categoryCollectionFactory @@ -75,12 +70,7 @@ class Product extends AbstractResource * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Eav\Model\Config $eavConfig, - \Magento\Eav\Model\Entity\Attribute\Set $attrSetEntity, - \Magento\Framework\Locale\FormatInterface $localeFormat, - \Magento\Eav\Model\Resource\Helper $resourceHelper, - \Magento\Framework\Validator\UniversalFactory $universalFactory, + \Magento\Eav\Model\Entity\Context $context, \Magento\Framework\Store\StoreManagerInterface $storeManager, \Magento\Catalog\Model\Factory $modelFactory, \Magento\Catalog\Model\Resource\Category\CollectionFactory $categoryCollectionFactory, @@ -96,12 +86,7 @@ public function __construct( $this->setFactory = $setFactory; $this->typeFactory = $typeFactory; parent::__construct( - $resource, - $eavConfig, - $attrSetEntity, - $localeFormat, - $resourceHelper, - $universalFactory, + $context, $storeManager, $modelFactory, $data diff --git a/app/code/Magento/Customer/Model/Resource/Address.php b/app/code/Magento/Customer/Model/Resource/Address.php index c047a54d3eeb8..3fbe59955af8a 100644 --- a/app/code/Magento/Customer/Model/Resource/Address.php +++ b/app/code/Magento/Customer/Model/Resource/Address.php @@ -22,38 +22,20 @@ class Address extends \Magento\Eav\Model\Entity\AbstractEntity protected $_customerFactory; /** - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Eav\Model\Config $eavConfig - * @param \Magento\Eav\Model\Entity\Attribute\Set $attrSetEntity - * @param \Magento\Framework\Locale\FormatInterface $localeFormat - * @param \Magento\Eav\Model\Resource\Helper $resourceHelper - * @param \Magento\Framework\Validator\UniversalFactory $universalFactory + * @param \Magento\Eav\Model\Entity\Context $context * @param \Magento\Framework\Validator\Factory $validatorFactory * @param \Magento\Customer\Model\CustomerFactory $customerFactory * @param array $data */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Eav\Model\Config $eavConfig, - \Magento\Eav\Model\Entity\Attribute\Set $attrSetEntity, - \Magento\Framework\Locale\FormatInterface $localeFormat, - \Magento\Eav\Model\Resource\Helper $resourceHelper, - \Magento\Framework\Validator\UniversalFactory $universalFactory, + \Magento\Eav\Model\Entity\Context $context, \Magento\Framework\Validator\Factory $validatorFactory, \Magento\Customer\Model\CustomerFactory $customerFactory, $data = [] ) { $this->_validatorFactory = $validatorFactory; $this->_customerFactory = $customerFactory; - parent::__construct( - $resource, - $eavConfig, - $attrSetEntity, - $localeFormat, - $resourceHelper, - $universalFactory, - $data - ); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Customer/Model/Resource/Customer.php b/app/code/Magento/Customer/Model/Resource/Customer.php index d362545e7eeeb..b594c9edce0a0 100644 --- a/app/code/Magento/Customer/Model/Resource/Customer.php +++ b/app/code/Magento/Customer/Model/Resource/Customer.php @@ -31,39 +31,20 @@ class Customer extends \Magento\Eav\Model\Entity\AbstractEntity protected $dateTime; /** - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Eav\Model\Config $eavConfig - * @param \Magento\Eav\Model\Entity\Attribute\Set $attrSetEntity - * @param \Magento\Framework\Locale\FormatInterface $localeFormat - * @param \Magento\Eav\Model\Resource\Helper $resourceHelper - * @param \Magento\Framework\Validator\UniversalFactory $universalFactory + * @param \Magento\Eav\Model\Entity\Context $context * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Framework\Validator\Factory $validatorFactory * @param \Magento\Framework\Stdlib\DateTime $dateTime * @param array $data - * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Eav\Model\Config $eavConfig, - \Magento\Eav\Model\Entity\Attribute\Set $attrSetEntity, - \Magento\Framework\Locale\FormatInterface $localeFormat, - \Magento\Eav\Model\Resource\Helper $resourceHelper, - \Magento\Framework\Validator\UniversalFactory $universalFactory, + \Magento\Eav\Model\Entity\Context $context, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Framework\Validator\Factory $validatorFactory, \Magento\Framework\Stdlib\DateTime $dateTime, $data = [] ) { - parent::__construct( - $resource, - $eavConfig, - $attrSetEntity, - $localeFormat, - $resourceHelper, - $universalFactory, - $data - ); + parent::__construct($context, $data); $this->_scopeConfig = $scopeConfig; $this->_validatorFactory = $validatorFactory; $this->dateTime = $dateTime; diff --git a/app/code/Magento/Eav/Model/Entity.php b/app/code/Magento/Eav/Model/Entity.php index 0008058ad9cda..03ac21a167d78 100644 --- a/app/code/Magento/Eav/Model/Entity.php +++ b/app/code/Magento/Eav/Model/Entity.php @@ -26,32 +26,12 @@ class Entity extends \Magento\Eav\Model\Entity\AbstractEntity const DEFAULT_ENTITY_ID_FIELD = 'entity_id'; /** - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Eav\Model\Config $eavConfig - * @param \Magento\Eav\Model\Entity\Attribute\Set $attrSetEntity - * @param \Magento\Framework\Locale\FormatInterface $localeFormat - * @param \Magento\Eav\Model\Resource\Helper $resourceHelper - * @param \Magento\Framework\Validator\UniversalFactory $universalFactory + * @param Entity\Context $context * @param array $data */ - public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Eav\Model\Config $eavConfig, - \Magento\Eav\Model\Entity\Attribute\Set $attrSetEntity, - \Magento\Framework\Locale\FormatInterface $localeFormat, - \Magento\Eav\Model\Resource\Helper $resourceHelper, - \Magento\Framework\Validator\UniversalFactory $universalFactory, - $data = [] - ) { - parent::__construct( - $resource, - $eavConfig, - $attrSetEntity, - $localeFormat, - $resourceHelper, - $universalFactory, - $data - ); - $this->setConnection($resource->getConnection('eav_read')); + public function __construct(\Magento\Eav\Model\Entity\Context $context, $data = []) + { + parent::__construct($context, $data); + $this->setConnection($this->_resource->getConnection('eav_read')); } } diff --git a/app/code/Magento/Eav/Model/Entity/AbstractEntity.php b/app/code/Magento/Eav/Model/Entity/AbstractEntity.php index e7d7baa3cd43b..14bdb3106db30 100644 --- a/app/code/Magento/Eav/Model/Entity/AbstractEntity.php +++ b/app/code/Magento/Eav/Model/Entity/AbstractEntity.php @@ -15,6 +15,8 @@ use Magento\Framework\App\Config\Element; use Magento\Framework\Model\AbstractModel; use Magento\Framework\Model\Exception; +use Magento\Framework\Model\Resource\Db\ObjectRelationProcessor; +use Magento\Framework\Model\Resource\Db\TransactionManagerInterface; /** * Entity/Attribute/Model - entity abstract @@ -191,29 +193,29 @@ abstract class AbstractEntity extends \Magento\Framework\Model\Resource\Abstract protected $_universalFactory; /** - * @param \Magento\Framework\App\Resource $resource - * @param \Magento\Eav\Model\Config $eavConfig - * @param \Magento\Eav\Model\Entity\Attribute\Set $attrSetEntity - * @param \Magento\Framework\Locale\FormatInterface $localeFormat - * @param \Magento\Eav\Model\Resource\Helper $resourceHelper - * @param \Magento\Framework\Validator\UniversalFactory $universalFactory + * @var TransactionManagerInterface + */ + protected $transactionManager; + + /** + * @var ObjectRelationProcessor + */ + protected $objectRelationProcessor; + + /** + * @param Context $context * @param array $data */ - public function __construct( - \Magento\Framework\App\Resource $resource, - \Magento\Eav\Model\Config $eavConfig, - \Magento\Eav\Model\Entity\Attribute\Set $attrSetEntity, - \Magento\Framework\Locale\FormatInterface $localeFormat, - \Magento\Eav\Model\Resource\Helper $resourceHelper, - \Magento\Framework\Validator\UniversalFactory $universalFactory, - $data = [] - ) { - $this->_eavConfig = $eavConfig; - $this->_resource = $resource; - $this->_attrSetEntity = $attrSetEntity; - $this->_localeFormat = $localeFormat; - $this->_resourceHelper = $resourceHelper; - $this->_universalFactory = $universalFactory; + public function __construct(Context $context, $data = []) + { + $this->_eavConfig = $context->getEavConfig(); + $this->_resource = $context->getResource(); + $this->_attrSetEntity = $context->getAttributeSetEntity(); + $this->_localeFormat = $context->getLocaleFormat(); + $this->_resourceHelper = $context->getResourceHelper(); + $this->_universalFactory = $context->getUniversalFactory(); + $this->transactionManager = $context->getTransactionManager(); + $this->objectRelationProcessor = $context->getObjectRelationProcessor(); parent::__construct(); $properties = get_object_vars($this); foreach ($data as $key => $value) { @@ -1714,19 +1716,24 @@ protected function getAttributeRow($entity, $object, $attribute) public function delete($object) { try { - $this->beginTransaction(); + $connection = $this->transactionManager->start($this->_getWriteAdapter()); if (is_numeric($object)) { $id = (int) $object; } elseif ($object instanceof \Magento\Framework\Object) { $object->beforeDelete(); $id = (int) $object->getId(); } - $this->_beforeDelete($object); - try { $where = [$this->getEntityIdField() . '=?' => $id]; - $this->_getWriteAdapter()->delete($this->getEntityTable(), $where); + $this->objectRelationProcessor->delete( + $this->transactionManager, + $connection, + $this->getEntityTable(), + $this->_getWriteAdapter()->quoteInto($this->getEntityIdField() . '=?', $id), + [$this->getEntityIdField() => $id] + ); + $this->loadAllAttributes($object); foreach ($this->getAttributesByTable() as $table => $attributes) { $this->_getWriteAdapter()->delete($table, $where); @@ -1741,12 +1748,12 @@ public function delete($object) $object->isDeleted(true); $object->afterDelete(); } - $this->commit(); + $this->transactionManager->commit(); if ($object instanceof \Magento\Framework\Object) { $object->afterDeleteCommit(); } } catch (\Exception $e) { - $this->rollBack(); + $this->transactionManager->rollBack(); throw $e; } return $this; diff --git a/app/code/Magento/Eav/Model/Entity/Context.php b/app/code/Magento/Eav/Model/Entity/Context.php new file mode 100644 index 0000000000000..9a7c53a629709 --- /dev/null +++ b/app/code/Magento/Eav/Model/Entity/Context.php @@ -0,0 +1,144 @@ +eavConfig = $eavConfig; + $this->resource = $resource; + $this->attributeSetEntity = $attrSetEntity; + $this->localeFormat = $localeFormat; + $this->resourceHelper = $resourceHelper; + $this->universalFactory = $universalFactory; + $this->transactionManager = $transactionManager; + $this->objectRelationProcessor = $objectRelationProcessor; + } + + /** + * @return \Magento\Eav\Model\Config + */ + public function getEavConfig() + { + return $this->eavConfig; + } + + /** + * @return \Magento\Framework\App\Resource + */ + public function getResource() + { + return $this->resource; + } + + /** + * @return Attribute\Set + */ + public function getAttributeSetEntity() + { + return $this->attributeSetEntity; + } + + /** + * @return \Magento\Framework\Locale\FormatInterface + */ + public function getLocaleFormat() + { + return $this->localeFormat; + } + + /** + * @return \Magento\Eav\Model\Resource\Helper + */ + public function getResourceHelper() + { + return $this->resourceHelper; + } + + /** + * @return \Magento\Framework\Validator\UniversalFactory + */ + public function getUniversalFactory() + { + return $this->universalFactory; + } + + /** + * @return \Magento\Framework\Model\Resource\Db\ObjectRelationProcessor + */ + public function getObjectRelationProcessor() + { + return $this->objectRelationProcessor; + } + + /** + * @return \Magento\Framework\Model\Resource\Db\TransactionManagerInterface + */ + public function getTransactionManager() + { + return $this->transactionManager; + } +} From 7c42442c92df57a89464627093007823ee52b5bf Mon Sep 17 00:00:00 2001 From: Olexii Korshenko Date: Thu, 12 Feb 2015 18:43:53 +0200 Subject: [PATCH 34/44] MAGETWO-32974: DB Foreign Keys Management on the Application Level - add validation logic for EAV models --- app/code/Magento/Eav/Model/Entity/AbstractEntity.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/code/Magento/Eav/Model/Entity/AbstractEntity.php b/app/code/Magento/Eav/Model/Entity/AbstractEntity.php index 14bdb3106db30..0883343a37962 100644 --- a/app/code/Magento/Eav/Model/Entity/AbstractEntity.php +++ b/app/code/Magento/Eav/Model/Entity/AbstractEntity.php @@ -1182,6 +1182,8 @@ public function save(\Magento\Framework\Object $object) $object->setParentId((int)$object->getParentId()); + $this->objectRelationProcessor->validateDataIntegrity($this->getEntityTable(), $object->getData()); + $this->_beforeSave($object); $this->_processSaveData($this->_collectSaveData($object)); $this->_afterSave($object); From 0fb99643f1926400fe6e4f022afcf78d733d0507 Mon Sep 17 00:00:00 2001 From: Olexii Korshenko Date: Fri, 13 Feb 2015 12:28:12 +0200 Subject: [PATCH 35/44] MAGETWO-34143: DB Foreign Keys Management on the Application Level. Builds Stabilization - fixed unit tests --- app/code/Magento/Eav/Model/Entity/Context.php | 2 +- .../Catalog/Model/Resource/AbstractTest.php | 17 +++----- .../Magento/Eav/Model/Entity/AbstractTest.php | 41 +++++++++++-------- .../Framework/App/Resource/ConfigTest.php | 22 +++++++--- 4 files changed, 47 insertions(+), 35 deletions(-) diff --git a/app/code/Magento/Eav/Model/Entity/Context.php b/app/code/Magento/Eav/Model/Entity/Context.php index 9a7c53a629709..755e663f619d7 100644 --- a/app/code/Magento/Eav/Model/Entity/Context.php +++ b/app/code/Magento/Eav/Model/Entity/Context.php @@ -6,7 +6,7 @@ namespace Magento\Eav\Model\Entity; -class Context +class Context implements \Magento\Framework\ObjectManager\ContextInterface { /** * @var \Magento\Eav\Model\Config diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Model/Resource/AbstractTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Model/Resource/AbstractTest.php index c1f9815215697..c63bf8f977ec2 100644 --- a/dev/tests/unit/testsuite/Magento/Catalog/Model/Resource/AbstractTest.php +++ b/dev/tests/unit/testsuite/Magento/Catalog/Model/Resource/AbstractTest.php @@ -9,6 +9,8 @@ */ namespace Magento\Catalog\Model\Resource; +use Magento\TestFramework\Helper\ObjectManager; + class AbstractTest extends \PHPUnit_Framework_TestCase { /** @@ -41,6 +43,8 @@ protected function _getAttributes() public function testWalkAttributes() { + $objectManager = new ObjectManager($this); + $code = 'test_attr'; $set = 10; @@ -78,20 +82,11 @@ public function testWalkAttributes() $attributes[$code] = $attribute; /** @var $model \Magento\Catalog\Model\Resource\AbstractResource */ + $arguments = $objectManager->getConstructArguments('Magento\Catalog\Model\Resource\AbstractResource'); $model = $this->getMock( 'Magento\Catalog\Model\Resource\AbstractResource', ['getAttributesByCode'], - [ - $this->getMock('Magento\Framework\App\Resource', [], [], '', false, false), - $this->getMock('Magento\Eav\Model\Config', [], [], '', false, false), - $this->getMock('Magento\Eav\Model\Entity\Attribute\Set', [], [], '', false, false), - $this->getMock('Magento\Framework\Locale\FormatInterface'), - $this->getMock('Magento\Eav\Model\Resource\Helper', [], [], '', false, false), - $this->getMock('Magento\Framework\Validator\UniversalFactory', [], [], '', false, false), - $this->getMock('Magento\Framework\Store\StoreManagerInterface', [], [], '', false), - $this->getMock('Magento\Catalog\Model\Factory', [], [], '', false), - [] - ] + $arguments ); $model->expects($this->once())->method('getAttributesByCode')->will($this->returnValue($attributes)); diff --git a/dev/tests/unit/testsuite/Magento/Eav/Model/Entity/AbstractTest.php b/dev/tests/unit/testsuite/Magento/Eav/Model/Entity/AbstractTest.php index a2dd2a161c1e5..a00ddb8744634 100644 --- a/dev/tests/unit/testsuite/Magento/Eav/Model/Entity/AbstractTest.php +++ b/dev/tests/unit/testsuite/Magento/Eav/Model/Entity/AbstractTest.php @@ -5,6 +5,8 @@ */ namespace Magento\Eav\Model\Entity; +use Magento\TestFramework\Helper\ObjectManager; + class AbstractTest extends \PHPUnit_Framework_TestCase { /** @@ -18,17 +20,15 @@ class AbstractTest extends \PHPUnit_Framework_TestCase protected function setUp() { + $objectManager = new ObjectManager($this); $this->eavConfig = $this->getMock('Magento\Eav\Model\Config', [], [], '', false); + $arguments = $objectManager->getConstructArguments( + 'Magento\Eav\Model\Entity\AbstractEntity', + ['eavConfig' => $this->eavConfig] + ); $this->_model = $this->getMockForAbstractClass( 'Magento\Eav\Model\Entity\AbstractEntity', - [ - $this->getMock('Magento\Framework\App\Resource', [], [], '', false), - $this->eavConfig, - $this->getMock('Magento\Eav\Model\Entity\Attribute\Set', [], [], '', false), - $this->getMock('\Magento\Framework\Locale\FormatInterface'), - $this->getMock('Magento\Eav\Model\Resource\Helper', [], [], '', false), - $this->getMock('Magento\Framework\Validator\UniversalFactory', [], [], '', false) - ] + $arguments ); } @@ -272,18 +272,23 @@ public function testSave($attributeCode, $attributeSetId, $productData, $product ->disableOriginalConstructor() ->getMock(); - $data = [ - $this->getMock('Magento\Framework\App\Resource', [], [], '', false), - $eavConfig, - $this->getMock('Magento\Eav\Model\Entity\Attribute\Set', [], [], '', false), - $this->getMock('Magento\Framework\Locale\FormatInterface'), - $this->getMock('Magento\Eav\Model\Resource\Helper', [], [], '', false), - $this->getMock('Magento\Framework\Validator\UniversalFactory', [], [], '', false), - ['type' => $entityType, 'entityTable' => 'entityTable', 'attributesByCode' => $attributes], - ]; + $objectManager = new ObjectManager($this); + $this->eavConfig = $this->getMock('Magento\Eav\Model\Config', [], [], '', false); + $arguments = $objectManager->getConstructArguments( + 'Magento\Eav\Model\Entity\AbstractEntity', + [ + 'eavConfig' => $eavConfig, + 'data' => [ + 'type' => $entityType, + 'entityTable' => 'entityTable', + 'attributesByCode' => $attributes + ] + ] + ); + /** @var $model \Magento\Framework\Model\AbstractModel|\PHPUnit_Framework_MockObject_MockObject */ $model = $this->getMockBuilder('Magento\Eav\Model\Entity\AbstractEntity') - ->setConstructorArgs($data) + ->setConstructorArgs($arguments) ->setMethods(['_getValue', 'beginTransaction', 'commit', 'rollback']) ->getMock(); diff --git a/dev/tests/unit/testsuite/Magento/Framework/App/Resource/ConfigTest.php b/dev/tests/unit/testsuite/Magento/Framework/App/Resource/ConfigTest.php index a072a11f71a7f..7dfa5530da411 100644 --- a/dev/tests/unit/testsuite/Magento/Framework/App/Resource/ConfigTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/App/Resource/ConfigTest.php @@ -65,12 +65,18 @@ protected function setUp() $this->returnValue(serialize($this->_resourcesConfig)) ); + $deploymentConfigMock = $this->getMock('\Magento\Framework\App\DeploymentConfig', [], [], '', false); + $deploymentConfigMock->expects($this->once()) + ->method('getSegment') + ->with('resource') + ->willReturn($this->_initialResources); + $this->_model = new \Magento\Framework\App\Resource\Config( $this->_readerMock, $this->_scopeMock, $this->_cacheMock, - 'cacheId', - $this->_initialResources + $deploymentConfigMock, + 'cacheId' ); } @@ -89,12 +95,18 @@ public function testGetConnectionName($resourceName, $connectionName) */ public function testExceptionConstructor() { + $deploymentConfigMock = $this->getMock('\Magento\Framework\App\DeploymentConfig', [], [], '', false); + $deploymentConfigMock->expects($this->once()) + ->method('getSegment') + ->with('resource') + ->willReturn(['validResource' => ['somekey' => 'validConnectionName']]); + new \Magento\Framework\App\Resource\Config( $this->_readerMock, $this->_scopeMock, $this->_cacheMock, - 'cacheId', - ['validResource' => ['somekey' => 'validConnectionName']] + $deploymentConfigMock, + 'cacheId' ); } @@ -110,7 +122,7 @@ public function getConnectionNameDataProvider() 'resourceName' => 'brokenResourceName', 'connectionName' => \Magento\Framework\App\Resource\Config::DEFAULT_SETUP_CONNECTION ], - ['resourceName' => 'extendedResourceName', 'connectionName' => 'default'], + ['resourceName' => 'extendedResourceName', 'connectionName' => 'validConnectionName'], ['resourceName' => 'validResource', 'connectionName' => 'validConnectionName'] ]; } From f879e33a94eb8840623bfe2634c82dcdacdffd3b Mon Sep 17 00:00:00 2001 From: Olexii Korshenko Date: Fri, 13 Feb 2015 13:43:08 +0200 Subject: [PATCH 36/44] MAGETWO-34143: DB Foreign Keys Management on the Application Level. Builds Stabilization - fixed static tests --- .../Framework/Model/Resource/Db/AbstractTest.php | 12 ++++++++++-- .../Model/Resource/Db/Collection/AbstractTest.php | 7 ++++++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/dev/tests/integration/testsuite/Magento/Framework/Model/Resource/Db/AbstractTest.php b/dev/tests/integration/testsuite/Magento/Framework/Model/Resource/Db/AbstractTest.php index 8730fa5f88420..bf47aeb3babee 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/Model/Resource/Db/AbstractTest.php +++ b/dev/tests/integration/testsuite/Magento/Framework/Model/Resource/Db/AbstractTest.php @@ -18,9 +18,13 @@ class AbstractTest extends \PHPUnit_Framework_TestCase protected function setUp() { $resource = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Framework\App\Resource'); - $this->_model = $this->getMockForAbstractClass('Magento\Framework\Model\Resource\Db\AbstractDb', + $context = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( + '\Magento\Framework\Model\Resource\Db\Context', ['resource' => $resource] ); + $this->_model = $this->getMockForAbstractClass('Magento\Framework\Model\Resource\Db\AbstractDb', + ['context' => $context] + ); } public function testConstruct() @@ -54,9 +58,13 @@ public function testGetTableName() 'Magento\Framework\App\Resource', ['tablePrefix' => 'prefix_'] ); + $context = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( + '\Magento\Framework\Model\Resource\Db\Context', + ['resource' => $resource] + ); $model = $this->getMockForAbstractClass('Magento\Framework\Model\Resource\Db\AbstractDb', - ['resource' => $resource] + ['context' => $context] ); $tableName = $model->getTable([$tableNameOrig, $tableSuffix]); diff --git a/dev/tests/integration/testsuite/Magento/Framework/Model/Resource/Db/Collection/AbstractTest.php b/dev/tests/integration/testsuite/Magento/Framework/Model/Resource/Db/Collection/AbstractTest.php index 9a0f7ca1a9bf5..a07cb44bd820c 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/Model/Resource/Db/Collection/AbstractTest.php +++ b/dev/tests/integration/testsuite/Magento/Framework/Model/Resource/Db/Collection/AbstractTest.php @@ -16,9 +16,14 @@ protected function setUp() { $resourceModel = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() ->get('Magento\Framework\App\Resource'); + $context = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( + '\Magento\Framework\Model\Resource\Db\Context', + ['resource' => $resourceModel] + ); + $resource = $this->getMockForAbstractClass( 'Magento\Framework\Model\Resource\Db\AbstractDb', - [$resourceModel], + [$context], '', true, true, From 9cc174c22df20ca970782c1629323deed78ab7be Mon Sep 17 00:00:00 2001 From: Olexii Korshenko Date: Mon, 16 Feb 2015 11:37:44 +0200 Subject: [PATCH 37/44] MAGETWO-34143: DB Foreign Keys Management on the Application Level. Builds Stabilization --- app/code/Magento/Catalog/Model/Resource/Product/Option.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Catalog/Model/Resource/Product/Option.php b/app/code/Magento/Catalog/Model/Resource/Product/Option.php index 8dca119b38031..27ee2f7505a24 100644 --- a/app/code/Magento/Catalog/Model/Resource/Product/Option.php +++ b/app/code/Magento/Catalog/Model/Resource/Product/Option.php @@ -45,8 +45,8 @@ class Option extends \Magento\Framework\Model\Resource\Db\AbstractDb public function __construct( \Magento\Framework\Model\Resource\Db\Context $context, \Magento\Directory\Model\CurrencyFactory $currencyFactory, - \Magento\Framework\Store\StoreManagerInterface $storeManager, - \Magento\Store\Model\StoreManagerInterface $config, + \Magento\Store\Model\StoreManagerInterface $storeManager, + \Magento\Framework\App\Config\ScopeConfigInterface $config, $resourcePrefix = null ) { $this->_currencyFactory = $currencyFactory; From fc68a8eb5f78acb7a8996635d0eeccb576f35d4f Mon Sep 17 00:00:00 2001 From: Olexii Korshenko Date: Wed, 18 Feb 2015 11:18:26 +0200 Subject: [PATCH 38/44] MAGETWO-34143: DB Foreign Keys Management on the Application Level. Builds Stabilization - fixed unit tests --- .../Model/Resource/AbstractResourceTest.php | 57 +++---------------- .../Model/Resource/Indexer/StateTest.php | 9 ++- .../Model/Resource/Mview/View/StateTest.php | 9 ++- 3 files changed, 24 insertions(+), 51 deletions(-) diff --git a/dev/tests/unit/testsuite/Magento/Indexer/Model/Resource/AbstractResourceTest.php b/dev/tests/unit/testsuite/Magento/Indexer/Model/Resource/AbstractResourceTest.php index ddb305a390221..ecb35c5a83694 100644 --- a/dev/tests/unit/testsuite/Magento/Indexer/Model/Resource/AbstractResourceTest.php +++ b/dev/tests/unit/testsuite/Magento/Indexer/Model/Resource/AbstractResourceTest.php @@ -17,55 +17,20 @@ class AbstractResourceTest extends \PHPUnit_Framework_TestCase */ protected $_resourceMock; - /** - * @var \Magento\Catalog\Model\CategoryFactory|\PHPUnit_Framework_MockObject_MockObject - */ - protected $_categoryFactoryMock; - - /** - * @var \Magento\Catalog\Model\Resource\Category\CollectionFactory|\PHPUnit_Framework_MockObject_MockObject - */ - protected $_categoryCollectionFactoryMock; - - /** - * @var \Magento\Store\Model\StoreManagerInterface|\PHPUnit_Framework_MockObject_MockObject - */ - protected $_storeManagerMock; - - /** - * @var \Magento\Catalog\Model\Config|\PHPUnit_Framework_MockObject_MockObject - */ - protected $_catalogConfigMock; - - /** - * @var \Magento\Framework\Event\ManagerInterface|\PHPUnit_Framework_MockObject_MockObject - */ - protected $_eventManagerMock; protected function setUp() { $this->_resourceMock = $this->getMockBuilder('Magento\Framework\App\Resource') ->disableOriginalConstructor() ->getMock(); - $this->_categoryFactoryMock = $this->getMockBuilder('Magento\Catalog\Model\CategoryFactory') - ->disableOriginalConstructor() - ->getMock(); - $this->_categoryCollectionFactoryMock = $this->getMockBuilder( - 'Magento\Catalog\Model\Resource\Category\CollectionFactory' - )->disableOriginalConstructor()->getMock(); - $this->_storeManagerMock = $this->getMock('Magento\Store\Model\StoreManagerInterface'); - $this->_catalogConfigMock = $this->getMockBuilder('Magento\Catalog\Model\Config') - ->disableOriginalConstructor() - ->getMock(); - $this->_eventManagerMock = $this->getMock('Magento\Framework\Event\ManagerInterface'); - - $this->model = new \Magento\Indexer\Model\Resource\AbstractResourceStub( - $this->_resourceMock, - $this->_categoryFactoryMock, - $this->_categoryCollectionFactoryMock, - $this->_storeManagerMock, - $this->_catalogConfigMock, - $this->_eventManagerMock + + $objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); + $arguments = $objectManager->getConstructArguments('\Magento\Indexer\Model\Resource\AbstractResourceStub', + ['resource' => $this->_resourceMock] + ); + $this->model = $objectManager->getObject( + '\Magento\Indexer\Model\Resource\AbstractResourceStub', + $arguments ); } @@ -86,9 +51,7 @@ public function testUseIdxTable() public function testClearTemporaryIndexTable() { $connectionMock = $this->getMock('Magento\Framework\DB\Adapter\AdapterInterface', [], [], '', false); - $storeMock = $this->getMock('Magento\Store\Model\Store', [], [], '', false); $this->_resourceMock->expects($this->any())->method('getConnection')->will($this->returnValue($connectionMock)); - $this->_storeManagerMock->expects($this->any())->method('getStore')->will($this->returnValue($storeMock)); $connectionMock->expects($this->once())->method('delete')->will($this->returnSelf()); $this->model->clearTemporaryIndexTable(); } @@ -101,7 +64,6 @@ public function testSyncData() $selectMock = $this->getMock('Magento\Framework\DB\Select', [], [], '', false); $connectionMock = $this->getMock('Magento\Framework\DB\Adapter\AdapterInterface', [], [], '', false); - $storeMock = $this->getMock('Magento\Store\Model\Store', [], [], '', false); $connectionMock->expects($this->any())->method('describeTable')->will($this->returnValue($describeTable)); $connectionMock->expects($this->any())->method('select')->will($this->returnValue($selectMock)); @@ -112,7 +74,6 @@ public function testSyncData() $resultColumns )->will($this->returnSelf()); - $this->_storeManagerMock->expects($this->any())->method('getStore')->will($this->returnValue($storeMock)); $this->_resourceMock->expects($this->any())->method('getConnection')->will($this->returnValue($connectionMock)); $this->_resourceMock->expects($this->any())->method('getTableName')->will($this->returnArgument(0)); @@ -147,13 +108,11 @@ public function testInsertFromTable($readToIndex) $selectMock = $this->getMock('Magento\Framework\DB\Select', [], [], '', false); $connectionMock = $this->getMock('Magento\Framework\DB\Adapter\AdapterInterface', [], [], '', false); - $storeMock = $this->getMock('Magento\Store\Model\Store', [], [], '', false); $connectionMock->expects($this->any())->method('describeTable')->will($this->returnValue($tableColumns)); $connectionMock->expects($this->any())->method('select')->will($this->returnValue($selectMock)); $selectMock->expects($this->any())->method('from')->will($this->returnSelf()); - $this->_storeManagerMock->expects($this->any())->method('getStore')->will($this->returnValue($storeMock)); if ($readToIndex) { $connectionCustomMock = $this->getMock( 'Magento\Framework\DB\Adapter\CustomAdapterInterface', diff --git a/dev/tests/unit/testsuite/Magento/Indexer/Model/Resource/Indexer/StateTest.php b/dev/tests/unit/testsuite/Magento/Indexer/Model/Resource/Indexer/StateTest.php index d86b9e821857e..f9a08140cd1bf 100644 --- a/dev/tests/unit/testsuite/Magento/Indexer/Model/Resource/Indexer/StateTest.php +++ b/dev/tests/unit/testsuite/Magento/Indexer/Model/Resource/Indexer/StateTest.php @@ -21,7 +21,14 @@ public function testConstruct() '', false ); - $this->model = new \Magento\Indexer\Model\Resource\Indexer\State($resourceMock); + $objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); + $arguments = $objectManager->getConstructArguments('\Magento\Indexer\Model\Resource\Indexer\State', + ['resource' => $resourceMock] + ); + $this->model = $objectManager->getObject( + '\Magento\Indexer\Model\Resource\Indexer\State', + $arguments + ); $this->assertEquals( [['field' => ['indexer_id'], 'title' => __('State for the same indexer')]], $this->model->getUniqueFields() diff --git a/dev/tests/unit/testsuite/Magento/Indexer/Model/Resource/Mview/View/StateTest.php b/dev/tests/unit/testsuite/Magento/Indexer/Model/Resource/Mview/View/StateTest.php index d368babe616f8..c7c2d78f35c00 100644 --- a/dev/tests/unit/testsuite/Magento/Indexer/Model/Resource/Mview/View/StateTest.php +++ b/dev/tests/unit/testsuite/Magento/Indexer/Model/Resource/Mview/View/StateTest.php @@ -21,7 +21,14 @@ public function testConstruct() '', false ); - $this->model = new \Magento\Indexer\Model\Resource\Mview\View\State($resourceMock); + $objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); + $arguments = $objectManager->getConstructArguments('\Magento\Indexer\Model\Resource\Mview\View\State', + ['resource' => $resourceMock] + ); + $this->model = $objectManager->getObject( + '\Magento\Indexer\Model\Resource\Mview\View\State', + $arguments + ); $this->assertEquals( [['field' => ['view_id'], 'title' => __('State for the same view')]], $this->model->getUniqueFields() From a23c1064b1e8ada476acf44640d23e508ca9e764 Mon Sep 17 00:00:00 2001 From: Olexii Korshenko Date: Wed, 18 Feb 2015 13:53:08 +0200 Subject: [PATCH 39/44] MAGETWO-33783: DB Foreign Keys Management on the Application Level. Unit tests coverage --- app/code/Magento/Eav/Model/Entity/Context.php | 3 +++ lib/internal/Magento/Framework/Model/Resource/Db/Context.php | 3 +++ 2 files changed, 6 insertions(+) diff --git a/app/code/Magento/Eav/Model/Entity/Context.php b/app/code/Magento/Eav/Model/Entity/Context.php index 755e663f619d7..9161fc6ed4f7c 100644 --- a/app/code/Magento/Eav/Model/Entity/Context.php +++ b/app/code/Magento/Eav/Model/Entity/Context.php @@ -6,6 +6,9 @@ namespace Magento\Eav\Model\Entity; +/** + * @codeCoverageIgnore + */ class Context implements \Magento\Framework\ObjectManager\ContextInterface { /** diff --git a/lib/internal/Magento/Framework/Model/Resource/Db/Context.php b/lib/internal/Magento/Framework/Model/Resource/Db/Context.php index d86c0efa461ac..916fefdec7966 100644 --- a/lib/internal/Magento/Framework/Model/Resource/Db/Context.php +++ b/lib/internal/Magento/Framework/Model/Resource/Db/Context.php @@ -6,6 +6,9 @@ namespace Magento\Framework\Model\Resource\Db; +/** + * @codeCoverageIgnore + */ class Context implements \Magento\Framework\ObjectManager\ContextInterface { /** From 9f063c6d1ef236bed64d5d00f90883bb7c94c753 Mon Sep 17 00:00:00 2001 From: Olexii Korshenko Date: Thu, 19 Feb 2015 17:56:01 +0200 Subject: [PATCH 40/44] MAGETWO-34269: quote_items are not deleted after delete product using import/export functionality --- .../Model/Import/Product.php | 37 ++++++++++++++++--- .../Resource/Db/ObjectRelationProcessor.php | 1 + 2 files changed, 32 insertions(+), 6 deletions(-) diff --git a/app/code/Magento/CatalogImportExport/Model/Import/Product.php b/app/code/Magento/CatalogImportExport/Model/Import/Product.php index 072f4cdb74f42..f278fd0d24b82 100644 --- a/app/code/Magento/CatalogImportExport/Model/Import/Product.php +++ b/app/code/Magento/CatalogImportExport/Model/Import/Product.php @@ -10,6 +10,8 @@ use Magento\Framework\App\Filesystem\DirectoryList; use Magento\CatalogImportExport\Model\Import\Product\RowValidatorInterface as ValidatorInterface; +use Magento\Framework\Model\Resource\Db\TransactionManagerInterface; +use Magento\Framework\Model\Resource\Db\ObjectRelationProcessor; /** * Import entity product model @@ -373,6 +375,16 @@ class Product extends \Magento\ImportExport\Model\Import\Entity\AbstractEntity */ protected $masterAttributeCode = 'sku'; + /** + * @var ObjectRelationProcessor + */ + protected $objectRelationProcessor; + + /** + * @var TransactionManagerInterface + */ + protected $transactionManager; + /** * @param \Magento\Core\Helper\Data $coreData * @param \Magento\ImportExport\Helper\Data $importExportData @@ -439,6 +451,8 @@ public function __construct( Product\SkuProcessor $skuProcessor, Product\CategoryProcessor $categoryProcessor, Product\Validator $validator, + ObjectRelationProcessor $objectRelationProcessor, + TransactionManagerInterface $transactionManager, array $data = [] ) { $this->_eventManager = $eventManager; @@ -463,6 +477,8 @@ public function __construct( $this->skuProcessor = $skuProcessor; $this->categoryProcessor = $categoryProcessor; $this->validator = $validator; + $this->objectRelationProcessor = $objectRelationProcessor; + $this->transactionManager = $transactionManager; parent::__construct($coreData, $importExportData, $importData, $config, $resource, $resourceHelper, $string); $this->_optionEntity = isset( $data['option_entity'] @@ -504,6 +520,7 @@ public function setParameters(array $params) * Delete products. * * @return $this + * @throws \Exception */ protected function _deleteProducts() { @@ -518,12 +535,20 @@ protected function _deleteProducts() } } if ($idToDelete) { - $this->_connection->query( - $this->_connection->quoteInto( - "DELETE FROM `{$productEntityTable}` WHERE `entity_id` IN (?)", - $idToDelete - ) - ); + $this->transactionManager->start($this->_connection); + try { + $this->objectRelationProcessor->delete( + $this->transactionManager, + $this->_connection, + $productEntityTable, + $this->_connection->quoteInto('entity_id IN (?)', $idToDelete), + ['entity_id' => $idToDelete] + ); + $this->transactionManager->commit(); + } catch (\Exception $e) { + $this->transactionManager->rollBack(); + throw $e; + } } } return $this; diff --git a/lib/internal/Magento/Framework/Model/Resource/Db/ObjectRelationProcessor.php b/lib/internal/Magento/Framework/Model/Resource/Db/ObjectRelationProcessor.php index 98bd0cfbe788e..d032014fa7c30 100644 --- a/lib/internal/Magento/Framework/Model/Resource/Db/ObjectRelationProcessor.php +++ b/lib/internal/Magento/Framework/Model/Resource/Db/ObjectRelationProcessor.php @@ -36,6 +36,7 @@ public function delete( * * @param string $table * @param array $involvedData + * @return void */ public function validateDataIntegrity($table, array $involvedData) { From 6d7eefca70ba8c93c70d23795eef6b03b1a00660 Mon Sep 17 00:00:00 2001 From: Olexii Korshenko Date: Thu, 19 Feb 2015 18:14:11 +0200 Subject: [PATCH 41/44] MAGETWO-34143: DB Foreign Keys Management on the Application Level. Builds Stabilization --- .../Magento/CatalogInventory/Model/Resource/Stock/Status.php | 2 +- .../Magento/Indexer/Model/Resource/AbstractResourceTest.php | 3 ++- .../Magento/Indexer/Model/Resource/Indexer/StateTest.php | 3 ++- .../Magento/Indexer/Model/Resource/Mview/View/StateTest.php | 3 ++- .../Magento/Framework/Model/Resource/Db/AbstractDb.php | 1 + .../Framework/Model/Resource/Db/ObjectRelationProcessor.php | 2 ++ 6 files changed, 10 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/CatalogInventory/Model/Resource/Stock/Status.php b/app/code/Magento/CatalogInventory/Model/Resource/Stock/Status.php index a08306e38945b..b3138b36b8db0 100644 --- a/app/code/Magento/CatalogInventory/Model/Resource/Stock/Status.php +++ b/app/code/Magento/CatalogInventory/Model/Resource/Stock/Status.php @@ -40,7 +40,7 @@ class Status extends \Magento\Framework\Model\Resource\Db\AbstractDb */ public function __construct( \Magento\Framework\Model\Resource\Db\Context $context, - \Magento\Store\Model\StoreManagerInterface$storeManager, + \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Store\Model\WebsiteFactory $websiteFactory, \Magento\Eav\Model\Config $eavConfig, $resourcePrefix = null diff --git a/dev/tests/unit/testsuite/Magento/Indexer/Model/Resource/AbstractResourceTest.php b/dev/tests/unit/testsuite/Magento/Indexer/Model/Resource/AbstractResourceTest.php index ecb35c5a83694..e4364e8d9a276 100644 --- a/dev/tests/unit/testsuite/Magento/Indexer/Model/Resource/AbstractResourceTest.php +++ b/dev/tests/unit/testsuite/Magento/Indexer/Model/Resource/AbstractResourceTest.php @@ -25,7 +25,8 @@ protected function setUp() ->getMock(); $objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); - $arguments = $objectManager->getConstructArguments('\Magento\Indexer\Model\Resource\AbstractResourceStub', + $arguments = $objectManager->getConstructArguments( + '\Magento\Indexer\Model\Resource\AbstractResourceStub', ['resource' => $this->_resourceMock] ); $this->model = $objectManager->getObject( diff --git a/dev/tests/unit/testsuite/Magento/Indexer/Model/Resource/Indexer/StateTest.php b/dev/tests/unit/testsuite/Magento/Indexer/Model/Resource/Indexer/StateTest.php index f9a08140cd1bf..b9e2c8fd05fce 100644 --- a/dev/tests/unit/testsuite/Magento/Indexer/Model/Resource/Indexer/StateTest.php +++ b/dev/tests/unit/testsuite/Magento/Indexer/Model/Resource/Indexer/StateTest.php @@ -22,7 +22,8 @@ public function testConstruct() false ); $objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); - $arguments = $objectManager->getConstructArguments('\Magento\Indexer\Model\Resource\Indexer\State', + $arguments = $objectManager->getConstructArguments( + '\Magento\Indexer\Model\Resource\Indexer\State', ['resource' => $resourceMock] ); $this->model = $objectManager->getObject( diff --git a/dev/tests/unit/testsuite/Magento/Indexer/Model/Resource/Mview/View/StateTest.php b/dev/tests/unit/testsuite/Magento/Indexer/Model/Resource/Mview/View/StateTest.php index c7c2d78f35c00..6eeb39aa40d42 100644 --- a/dev/tests/unit/testsuite/Magento/Indexer/Model/Resource/Mview/View/StateTest.php +++ b/dev/tests/unit/testsuite/Magento/Indexer/Model/Resource/Mview/View/StateTest.php @@ -22,7 +22,8 @@ public function testConstruct() false ); $objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); - $arguments = $objectManager->getConstructArguments('\Magento\Indexer\Model\Resource\Mview\View\State', + $arguments = $objectManager->getConstructArguments( + '\Magento\Indexer\Model\Resource\Mview\View\State', ['resource' => $resourceMock] ); $this->model = $objectManager->getObject( diff --git a/lib/internal/Magento/Framework/Model/Resource/Db/AbstractDb.php b/lib/internal/Magento/Framework/Model/Resource/Db/AbstractDb.php index 88b9b08719792..937d73f82b800 100644 --- a/lib/internal/Magento/Framework/Model/Resource/Db/AbstractDb.php +++ b/lib/internal/Magento/Framework/Model/Resource/Db/AbstractDb.php @@ -11,6 +11,7 @@ /** * Abstract resource model class * @SuppressWarnings(PHPMD.NumberOfChildren) + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ abstract class AbstractDb extends \Magento\Framework\Model\Resource\AbstractResource { diff --git a/lib/internal/Magento/Framework/Model/Resource/Db/ObjectRelationProcessor.php b/lib/internal/Magento/Framework/Model/Resource/Db/ObjectRelationProcessor.php index d032014fa7c30..5b3f620d9606b 100644 --- a/lib/internal/Magento/Framework/Model/Resource/Db/ObjectRelationProcessor.php +++ b/lib/internal/Magento/Framework/Model/Resource/Db/ObjectRelationProcessor.php @@ -20,6 +20,7 @@ class ObjectRelationProcessor * @param array $involvedData * @return void * @throws \LogicException + * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function delete( TransactionManagerInterface $transactionManager, @@ -37,6 +38,7 @@ public function delete( * @param string $table * @param array $involvedData * @return void + * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function validateDataIntegrity($table, array $involvedData) { From 08c04e1c7699bb30bcce0458dc2665d5aad8bc56 Mon Sep 17 00:00:00 2001 From: Olexii Korshenko Date: Thu, 19 Feb 2015 18:56:35 +0200 Subject: [PATCH 42/44] MAGETWO-34143: DB Foreign Keys Management on the Application Level. Builds Stabilization --- app/code/Magento/ProductAlert/Model/Resource/Stock.php | 3 ++- .../testsuite/Magento/Eav/Model/Entity/AbstractTest.php | 8 -------- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/app/code/Magento/ProductAlert/Model/Resource/Stock.php b/app/code/Magento/ProductAlert/Model/Resource/Stock.php index eabb32ec9f044..e9a1b6491d752 100644 --- a/app/code/Magento/ProductAlert/Model/Resource/Stock.php +++ b/app/code/Magento/ProductAlert/Model/Resource/Stock.php @@ -25,7 +25,8 @@ class Stock extends \Magento\ProductAlert\Model\Resource\AbstractResource */ public function __construct( \Magento\Framework\Model\Resource\Db\Context $context, - \Magento\Framework\Stdlib\DateTime\DateTimeFactory $dateFactory + \Magento\Framework\Stdlib\DateTime\DateTimeFactory $dateFactory, + $resourcePrefix = null ) { $this->_dateFactory = $dateFactory; parent::__construct($context, $resourcePrefix); diff --git a/dev/tests/unit/testsuite/Magento/Eav/Model/Entity/AbstractTest.php b/dev/tests/unit/testsuite/Magento/Eav/Model/Entity/AbstractTest.php index a00ddb8744634..78bd87aa00b22 100644 --- a/dev/tests/unit/testsuite/Magento/Eav/Model/Entity/AbstractTest.php +++ b/dev/tests/unit/testsuite/Magento/Eav/Model/Entity/AbstractTest.php @@ -262,16 +262,12 @@ public function testSave($attributeCode, $attributeSetId, $productData, $product ); $backendModel->setAttribute($attribute); - $attribute->expects($this->any())->method('getBackend')->will($this->returnValue($backendModel)); $attribute->setId(222); - $attributes[$attributeCode] = $attribute; - $eavConfig = $this->getMockBuilder('Magento\Eav\Model\Config') ->disableOriginalConstructor() ->getMock(); - $objectManager = new ObjectManager($this); $this->eavConfig = $this->getMock('Magento\Eav\Model\Config', [], [], '', false); $arguments = $objectManager->getConstructArguments( @@ -285,13 +281,11 @@ public function testSave($attributeCode, $attributeSetId, $productData, $product ] ] ); - /** @var $model \Magento\Framework\Model\AbstractModel|\PHPUnit_Framework_MockObject_MockObject */ $model = $this->getMockBuilder('Magento\Eav\Model\Entity\AbstractEntity') ->setConstructorArgs($arguments) ->setMethods(['_getValue', 'beginTransaction', 'commit', 'rollback']) ->getMock(); - $model->expects($this->any())->method('_getValue')->will($this->returnValue($eavConfig)); $eavConfig->expects($this->any())->method('getAttribute')->will( $this->returnCallback( @@ -300,10 +294,8 @@ function ($entityType, $attributeCode) use ($attributes) { } ) ); - $model->setConnection($this->_getAdapterMock()); $model->isPartialSave(true); - $model->save($object); } From 3e64773452703a3fb7ccb9982f976fe182859d5f Mon Sep 17 00:00:00 2001 From: Iryna Lagno Date: Fri, 20 Feb 2015 12:40:01 +0200 Subject: [PATCH 43/44] MAGETWO-34294: There is no ability to create bundle product --- app/code/Magento/Bundle/Model/Resource/Bundle.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/Bundle/Model/Resource/Bundle.php b/app/code/Magento/Bundle/Model/Resource/Bundle.php index 6f34a27f1d655..12f66f7346e8b 100644 --- a/app/code/Magento/Bundle/Model/Resource/Bundle.php +++ b/app/code/Magento/Bundle/Model/Resource/Bundle.php @@ -17,18 +17,26 @@ class Bundle extends \Magento\Framework\Model\Resource\Db\AbstractDb */ protected $_productRelation; + /** + * @var \Magento\Quote\Model\Resource\Quote + */ + protected $quoteResource; + /** * @param \Magento\Framework\Model\Resource\Db\Context $context * @param \Magento\Catalog\Model\Resource\Product\Relation $productRelation - * @param string|null $resourcePrefix + * @param \Magento\Quote\Model\Resource\Quote $quoteResource + * @param null $resourcePrefix */ public function __construct( \Magento\Framework\Model\Resource\Db\Context $context, \Magento\Catalog\Model\Resource\Product\Relation $productRelation, + \Magento\Quote\Model\Resource\Quote $quoteResource, $resourcePrefix = null ) { parent::__construct($context, $resourcePrefix); $this->_productRelation = $productRelation; + $this->quoteResource = $quoteResource; } /** @@ -85,7 +93,8 @@ public function getSelectionsData($productId) */ public function dropAllQuoteChildItems($productId) { - $quoteItemIds = $this->_getReadAdapter()->fetchCol( + $adapter = $this->quoteResource->getReadConnection()->select()->getAdapter(); + $quoteItemIds = $adapter->fetchCol( $this->_getReadAdapter()->select()->from( $this->getTable('quote_item'), ['item_id'] @@ -96,7 +105,7 @@ public function dropAllQuoteChildItems($productId) ); if ($quoteItemIds) { - $this->_getWriteAdapter()->delete( + $adapter->delete( $this->getTable('quote_item'), ['parent_item_id IN(?)' => $quoteItemIds] ); From 26c5dc1872161c4970ea2f6bdf1a797233399df1 Mon Sep 17 00:00:00 2001 From: Iryna Lagno Date: Fri, 20 Feb 2015 12:56:24 +0200 Subject: [PATCH 44/44] MAGETWO-34294: There is no ability to create bundle product --- app/code/Magento/Bundle/Model/Resource/Bundle.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Bundle/Model/Resource/Bundle.php b/app/code/Magento/Bundle/Model/Resource/Bundle.php index 12f66f7346e8b..02365f5e3ff38 100644 --- a/app/code/Magento/Bundle/Model/Resource/Bundle.php +++ b/app/code/Magento/Bundle/Model/Resource/Bundle.php @@ -93,9 +93,10 @@ public function getSelectionsData($productId) */ public function dropAllQuoteChildItems($productId) { - $adapter = $this->quoteResource->getReadConnection()->select()->getAdapter(); + $select = $this->quoteResource->getReadConnection()->select(); + $adapter = $select->getAdapter(); $quoteItemIds = $adapter->fetchCol( - $this->_getReadAdapter()->select()->from( + $select->from( $this->getTable('quote_item'), ['item_id'] )->where(