Skip to content

Commit f4121a4

Browse files
committed
Merge pull request magento#110 from magento-folks/develop
[Folks] Sprint 62 Contribution
2 parents c587bcc + 2629ad0 commit f4121a4

File tree

143 files changed

+1529
-703
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

143 files changed

+1529
-703
lines changed

app/code/Magento/Authorization/Model/Resource/Role.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,19 @@ class Role extends \Magento\Framework\Model\Resource\Db\AbstractDb
3232
protected $dateTime;
3333

3434
/**
35-
* @param \Magento\Framework\App\Resource $resource
35+
* @param \Magento\Framework\Model\Resource\Db\Context $context
3636
* @param \Magento\Framework\App\CacheInterface $cache
3737
* @param \Magento\Framework\Stdlib\DateTime $dateTime
38+
* @param string|null $resourcePrefix
3839
*/
3940
public function __construct(
40-
\Magento\Framework\App\Resource $resource,
41+
\Magento\Framework\Model\Resource\Db\Context $context,
4142
\Magento\Framework\App\CacheInterface $cache,
42-
\Magento\Framework\Stdlib\DateTime $dateTime
43+
\Magento\Framework\Stdlib\DateTime $dateTime,
44+
$resourcePrefix = null
4345
) {
4446
$this->dateTime = $dateTime;
45-
parent::__construct($resource);
47+
parent::__construct($context, $resourcePrefix);
4648
$this->_cache = $cache->getFrontend();
4749
}
4850

app/code/Magento/Authorization/Model/Resource/Rules.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,21 +38,23 @@ class Rules extends \Magento\Framework\Model\Resource\Db\AbstractDb
3838
protected $_logger;
3939

4040
/**
41-
* @param \Magento\Framework\App\Resource $resource
41+
* @param \Magento\Framework\Model\Resource\Db\Context $context
4242
* @param \Magento\Framework\Acl\Builder $aclBuilder
4343
* @param \Psr\Log\LoggerInterface $logger
4444
* @param \Magento\Framework\Acl\RootResource $rootResource
4545
* @param \Magento\Framework\Acl\CacheInterface $aclCache
46+
* @param string|null $resourcePrefix
4647
*/
4748
public function __construct(
48-
\Magento\Framework\App\Resource $resource,
49+
\Magento\Framework\Model\Resource\Db\Context $context,
4950
\Magento\Framework\Acl\Builder $aclBuilder,
5051
\Psr\Log\LoggerInterface $logger,
5152
\Magento\Framework\Acl\RootResource $rootResource,
52-
\Magento\Framework\Acl\CacheInterface $aclCache
53+
\Magento\Framework\Acl\CacheInterface $aclCache,
54+
$resourcePrefix = null
5355
) {
5456
$this->_aclBuilder = $aclBuilder;
55-
parent::__construct($resource);
57+
parent::__construct($context, $resourcePrefix);
5658
$this->_rootResource = $rootResource;
5759
$this->_aclCache = $aclCache;
5860
$this->_logger = $logger;

app/code/Magento/Bundle/Model/Resource/Bundle.php

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,25 @@ class Bundle extends \Magento\Framework\Model\Resource\Db\AbstractDb
1818
protected $_productRelation;
1919

2020
/**
21-
* @param \Magento\Framework\App\Resource $resource
21+
* @var \Magento\Quote\Model\Resource\Quote
22+
*/
23+
protected $quoteResource;
24+
25+
/**
26+
* @param \Magento\Framework\Model\Resource\Db\Context $context
2227
* @param \Magento\Catalog\Model\Resource\Product\Relation $productRelation
28+
* @param \Magento\Quote\Model\Resource\Quote $quoteResource
29+
* @param null $resourcePrefix
2330
*/
2431
public function __construct(
25-
\Magento\Framework\App\Resource $resource,
26-
\Magento\Catalog\Model\Resource\Product\Relation $productRelation
32+
\Magento\Framework\Model\Resource\Db\Context $context,
33+
\Magento\Catalog\Model\Resource\Product\Relation $productRelation,
34+
\Magento\Quote\Model\Resource\Quote $quoteResource,
35+
$resourcePrefix = null
2736
) {
28-
parent::__construct($resource);
37+
parent::__construct($context, $resourcePrefix);
2938
$this->_productRelation = $productRelation;
39+
$this->quoteResource = $quoteResource;
3040
}
3141

3242
/**
@@ -83,8 +93,10 @@ public function getSelectionsData($productId)
8393
*/
8494
public function dropAllQuoteChildItems($productId)
8595
{
86-
$quoteItemIds = $this->_getReadAdapter()->fetchCol(
87-
$this->_getReadAdapter()->select()->from(
96+
$select = $this->quoteResource->getReadConnection()->select();
97+
$adapter = $select->getAdapter();
98+
$quoteItemIds = $adapter->fetchCol(
99+
$select->from(
88100
$this->getTable('quote_item'),
89101
['item_id']
90102
)->where(
@@ -94,7 +106,7 @@ public function dropAllQuoteChildItems($productId)
94106
);
95107

96108
if ($quoteItemIds) {
97-
$this->_getWriteAdapter()->delete(
109+
$adapter->delete(
98110
$this->getTable('quote_item'),
99111
['parent_item_id IN(?)' => $quoteItemIds]
100112
);

app/code/Magento/Bundle/Model/Resource/Option.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,16 @@ class Option extends \Magento\Framework\Model\Resource\Db\AbstractDb
1818
private $validator;
1919

2020
/**
21-
* @param \Magento\Framework\App\Resource $resource
21+
* @param \Magento\Framework\Model\Resource\Db\Context $context
2222
* @param \Magento\Bundle\Model\Option\Validator $validator
23+
* @param string|null $resourcePrefix
2324
*/
2425
public function __construct(
25-
\Magento\Framework\App\Resource $resource,
26-
\Magento\Bundle\Model\Option\Validator $validator
26+
\Magento\Framework\Model\Resource\Db\Context $context,
27+
\Magento\Bundle\Model\Option\Validator $validator,
28+
$resourcePrefix = null
2729
) {
28-
parent::__construct($resource);
30+
parent::__construct($context, $resourcePrefix);
2931
$this->validator = $validator;
3032
}
3133

app/code/Magento/Captcha/Model/Resource/Log.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,20 @@ class Log extends \Magento\Framework\Model\Resource\Db\AbstractDb
3535
protected $_remoteAddress;
3636

3737
/**
38-
* @param \Magento\Framework\App\Resource $resource
38+
* @param \Magento\Framework\Model\Resource\Db\Context $context
3939
* @param \Magento\Framework\Stdlib\DateTime\DateTime $coreDate
4040
* @param \Magento\Framework\HTTP\PhpEnvironment\RemoteAddress $remoteAddress
41+
* @param string|null $resourcePrefix
4142
*/
4243
public function __construct(
43-
\Magento\Framework\App\Resource $resource,
44+
\Magento\Framework\Model\Resource\Db\Context $context,
4445
\Magento\Framework\Stdlib\DateTime\DateTime $coreDate,
45-
\Magento\Framework\HTTP\PhpEnvironment\RemoteAddress $remoteAddress
46+
\Magento\Framework\HTTP\PhpEnvironment\RemoteAddress $remoteAddress,
47+
$resourcePrefix = null
4648
) {
4749
$this->_coreDate = $coreDate;
4850
$this->_remoteAddress = $remoteAddress;
49-
parent::__construct($resource);
51+
parent::__construct($context, $resourcePrefix);
5052
}
5153

5254
/**

app/code/Magento/Catalog/Model/Resource/AbstractResource.php

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -38,40 +38,20 @@ abstract class AbstractResource extends \Magento\Eav\Model\Entity\AbstractEntity
3838
protected $_modelFactory;
3939

4040
/**
41-
* Construct
42-
*
43-
* @param \Magento\Framework\App\Resource $resource
44-
* @param \Magento\Eav\Model\Config $eavConfig
45-
* @param \Magento\Eav\Model\Entity\Attribute\Set $attrSetEntity
46-
* @param \Magento\Framework\Locale\FormatInterface $localeFormat
47-
* @param \Magento\Eav\Model\Resource\Helper $resourceHelper
48-
* @param \Magento\Framework\Validator\UniversalFactory $universalFactory
41+
* @param \Magento\Eav\Model\Entity\Context $context
4942
* @param \Magento\Store\Model\StoreManagerInterface $storeManager
5043
* @param \Magento\Catalog\Model\Factory $modelFactory
5144
* @param array $data
5245
*/
5346
public function __construct(
54-
\Magento\Framework\App\Resource $resource,
55-
\Magento\Eav\Model\Config $eavConfig,
56-
\Magento\Eav\Model\Entity\Attribute\Set $attrSetEntity,
57-
\Magento\Framework\Locale\FormatInterface $localeFormat,
58-
\Magento\Eav\Model\Resource\Helper $resourceHelper,
59-
\Magento\Framework\Validator\UniversalFactory $universalFactory,
47+
\Magento\Eav\Model\Entity\Context $context,
6048
\Magento\Store\Model\StoreManagerInterface $storeManager,
6149
\Magento\Catalog\Model\Factory $modelFactory,
6250
$data = []
6351
) {
6452
$this->_storeManager = $storeManager;
6553
$this->_modelFactory = $modelFactory;
66-
parent::__construct(
67-
$resource,
68-
$eavConfig,
69-
$attrSetEntity,
70-
$localeFormat,
71-
$resourceHelper,
72-
$universalFactory,
73-
$data
74-
);
54+
parent::__construct($context, $data);
7555
}
7656

7757
/**

app/code/Magento/Catalog/Model/Resource/Attribute.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,22 +27,24 @@ class Attribute extends \Magento\Eav\Model\Resource\Entity\Attribute
2727
protected $attrLockValidator;
2828

2929
/**
30-
* @param \Magento\Framework\App\Resource $resource
30+
* @param \Magento\Framework\Model\Resource\Db\Context $context
3131
* @param \Magento\Store\Model\StoreManagerInterface $storeManager
3232
* @param \Magento\Eav\Model\Resource\Entity\Type $eavEntityType
3333
* @param \Magento\Eav\Model\Config $eavConfig
3434
* @param LockValidatorInterface $lockValidator
35+
* @param string|null $resourcePrefix
3536
*/
3637
public function __construct(
37-
\Magento\Framework\App\Resource $resource,
38+
\Magento\Framework\Model\Resource\Db\Context $context,
3839
\Magento\Store\Model\StoreManagerInterface $storeManager,
3940
\Magento\Eav\Model\Resource\Entity\Type $eavEntityType,
4041
\Magento\Eav\Model\Config $eavConfig,
41-
LockValidatorInterface $lockValidator
42+
LockValidatorInterface $lockValidator,
43+
$resourcePrefix = null
4244
) {
4345
$this->attrLockValidator = $lockValidator;
4446
$this->_eavConfig = $eavConfig;
45-
parent::__construct($resource, $storeManager, $eavEntityType);
47+
parent::__construct($context, $storeManager, $eavEntityType, $resourcePrefix);
4648
}
4749

4850
/**

app/code/Magento/Catalog/Model/Resource/Category.php

Lines changed: 5 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -66,30 +66,16 @@ class Category extends AbstractResource
6666
protected $_categoryTreeFactory;
6767

6868
/**
69-
* Construct
70-
*
71-
* @param \Magento\Framework\App\Resource $resource
72-
* @param \Magento\Eav\Model\Config $eavConfig
73-
* @param \Magento\Eav\Model\Entity\Attribute\Set $attrSetEntity
74-
* @param \Magento\Framework\Locale\FormatInterface $localeFormat
75-
* @param \Magento\Eav\Model\Resource\Helper $resourceHelper
76-
* @param \Magento\Framework\Validator\UniversalFactory $universalFactory
69+
* @param \Magento\Eav\Model\Entity\Context $context
7770
* @param \Magento\Store\Model\StoreManagerInterface $storeManager
7871
* @param \Magento\Catalog\Model\Factory $modelFactory
7972
* @param \Magento\Framework\Event\ManagerInterface $eventManager
80-
* @param \Magento\Catalog\Model\Resource\Category\TreeFactory $categoryTreeFactory
81-
* @param \Magento\Catalog\Model\Resource\Category\CollectionFactory $categoryCollectionFactory
73+
* @param Category\TreeFactory $categoryTreeFactory
74+
* @param Category\CollectionFactory $categoryCollectionFactory
8275
* @param array $data
83-
*
84-
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
8576
*/
8677
public function __construct(
87-
\Magento\Framework\App\Resource $resource,
88-
\Magento\Eav\Model\Config $eavConfig,
89-
\Magento\Eav\Model\Entity\Attribute\Set $attrSetEntity,
90-
\Magento\Framework\Locale\FormatInterface $localeFormat,
91-
\Magento\Eav\Model\Resource\Helper $resourceHelper,
92-
\Magento\Framework\Validator\UniversalFactory $universalFactory,
78+
\Magento\Eav\Model\Entity\Context $context,
9379
\Magento\Store\Model\StoreManagerInterface $storeManager,
9480
\Magento\Catalog\Model\Factory $modelFactory,
9581
\Magento\Framework\Event\ManagerInterface $eventManager,
@@ -98,12 +84,7 @@ public function __construct(
9884
$data = []
9985
) {
10086
parent::__construct(
101-
$resource,
102-
$eavConfig,
103-
$attrSetEntity,
104-
$localeFormat,
105-
$resourceHelper,
106-
$universalFactory,
87+
$context,
10788
$storeManager,
10889
$modelFactory,
10990
$data

app/code/Magento/Catalog/Model/Resource/Category/Flat.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,27 +78,29 @@ class Flat extends \Magento\Indexer\Model\Resource\AbstractResource
7878
protected $_categoryFactory;
7979

8080
/**
81-
* @param \Magento\Framework\App\Resource $resource
81+
* @param \Magento\Framework\Model\Resource\Db\Context $context
8282
* @param \Magento\Catalog\Model\CategoryFactory $categoryFactory
83-
* @param \Magento\Catalog\Model\Resource\Category\CollectionFactory $categoryCollectionFactory
83+
* @param CollectionFactory $categoryCollectionFactory
8484
* @param \Magento\Store\Model\StoreManagerInterface $storeManager
8585
* @param \Magento\Catalog\Model\Config $catalogConfig
8686
* @param \Magento\Framework\Event\ManagerInterface $eventManager
87+
* @param string|null $resourcePrefix
8788
*/
8889
public function __construct(
89-
\Magento\Framework\App\Resource $resource,
90+
\Magento\Framework\Model\Resource\Db\Context $context,
9091
\Magento\Catalog\Model\CategoryFactory $categoryFactory,
9192
\Magento\Catalog\Model\Resource\Category\CollectionFactory $categoryCollectionFactory,
9293
\Magento\Store\Model\StoreManagerInterface $storeManager,
9394
\Magento\Catalog\Model\Config $catalogConfig,
94-
\Magento\Framework\Event\ManagerInterface $eventManager
95+
\Magento\Framework\Event\ManagerInterface $eventManager,
96+
$resourcePrefix = null
9597
) {
9698
$this->_categoryFactory = $categoryFactory;
9799
$this->_categoryCollectionFactory = $categoryCollectionFactory;
98100
$this->_storeManager = $storeManager;
99101
$this->_catalogConfig = $catalogConfig;
100102
$this->_eventManager = $eventManager;
101-
parent::__construct($resource);
103+
parent::__construct($context, $resourcePrefix);
102104
}
103105

104106
/**

app/code/Magento/Catalog/Model/Resource/Config.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,18 +41,20 @@ class Config extends \Magento\Framework\Model\Resource\Db\AbstractDb
4141
protected $_storeManager;
4242

4343
/**
44-
* @param \Magento\Framework\App\Resource $resource
44+
* @param \Magento\Framework\Model\Resource\Db\Context $context
4545
* @param \Magento\Store\Model\StoreManagerInterface $storeManager
4646
* @param \Magento\Eav\Model\Config $eavConfig
47+
* @param string|null $resourcePrefix
4748
*/
4849
public function __construct(
49-
\Magento\Framework\App\Resource $resource,
50+
\Magento\Framework\Model\Resource\Db\Context $context,
5051
\Magento\Store\Model\StoreManagerInterface $storeManager,
51-
\Magento\Eav\Model\Config $eavConfig
52+
\Magento\Eav\Model\Config $eavConfig,
53+
$resourcePrefix = null
5254
) {
5355
$this->_storeManager = $storeManager;
5456
$this->_eavConfig = $eavConfig;
55-
parent::__construct($resource);
57+
parent::__construct($context, $resourcePrefix);
5658
}
5759

5860
/**

app/code/Magento/Catalog/Model/Resource/Layer/Filter/Price.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,24 +38,26 @@ class Price extends \Magento\Framework\Model\Resource\Db\AbstractDb
3838
private $storeManager;
3939

4040
/**
41-
* @param \Magento\Framework\App\Resource $resource
41+
* @param \Magento\Framework\Model\Resource\Db\Context $context
4242
* @param \Magento\Framework\Event\ManagerInterface $eventManager
4343
* @param \Magento\Catalog\Model\Layer\Resolver $layerResolver
4444
* @param \Magento\Customer\Model\Session $session
4545
* @param \Magento\Store\Model\StoreManagerInterface $storeManager
46+
* @param string|null $resourcePrefix
4647
*/
4748
public function __construct(
48-
\Magento\Framework\App\Resource $resource,
49+
\Magento\Framework\Model\Resource\Db\Context $context,
4950
\Magento\Framework\Event\ManagerInterface $eventManager,
5051
\Magento\Catalog\Model\Layer\Resolver $layerResolver,
5152
\Magento\Customer\Model\Session $session,
52-
\Magento\Store\Model\StoreManagerInterface $storeManager
53+
\Magento\Store\Model\StoreManagerInterface $storeManager,
54+
$resourcePrefix = null
5355
) {
5456
$this->layer = $layerResolver->get();
5557
$this->session = $session;
5658
$this->storeManager = $storeManager;
5759
$this->_eventManager = $eventManager;
58-
parent::__construct($resource);
60+
parent::__construct($context, $resourcePrefix);
5961
}
6062

6163
/**

0 commit comments

Comments
 (0)