Skip to content

Commit

Permalink
MC-15995: Revert change of PR 3766
Browse files Browse the repository at this point in the history
  • Loading branch information
krissyhiserote committed Apr 24, 2019
1 parent 645941c commit 06019a6
Show file tree
Hide file tree
Showing 28 changed files with 345 additions and 534 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

use Magento\CatalogUrlRewrite\Model\CategoryUrlRewriteGenerator;
use Magento\Framework\App\Config\ScopeConfigInterface;
use Magento\Framework\Model\ResourceModel\ResourceModelPoolInterface;
use Magento\Store\Model\ScopeInterface;

/**
Expand Down Expand Up @@ -83,8 +82,6 @@ class Collection extends \Magento\Catalog\Model\ResourceModel\Collection\Abstrac
* @param \Magento\Store\Model\StoreManagerInterface $storeManager
* @param \Magento\Framework\DB\Adapter\AdapterInterface $connection
* @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
*
* @param ResourceModelPoolInterface|null $resourceModelPool
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
*/
public function __construct(
Expand All @@ -99,8 +96,7 @@ public function __construct(
\Magento\Framework\Validator\UniversalFactory $universalFactory,
\Magento\Store\Model\StoreManagerInterface $storeManager,
\Magento\Framework\DB\Adapter\AdapterInterface $connection = null,
\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig = null,
ResourceModelPoolInterface $resourceModelPool = null
\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig = null
) {
parent::__construct(
$entityFactory,
Expand All @@ -113,8 +109,7 @@ public function __construct(
$resourceHelper,
$universalFactory,
$storeManager,
$connection,
$resourceModelPool
$connection
);
$this->scopeConfig = $scopeConfig ?:
\Magento\Framework\App\ObjectManager::getInstance()->get(ScopeConfigInterface::class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
*/
namespace Magento\Catalog\Model\ResourceModel\Collection;

use Magento\Framework\Model\ResourceModel\ResourceModelPoolInterface;

/**
* Catalog EAV collection resource abstract model
*
Expand Down Expand Up @@ -45,8 +43,6 @@ class AbstractCollection extends \Magento\Eav\Model\Entity\Collection\AbstractCo
* @param \Magento\Framework\Validator\UniversalFactory $universalFactory
* @param \Magento\Store\Model\StoreManagerInterface $storeManager
* @param \Magento\Framework\DB\Adapter\AdapterInterface $connection
*
* @param ResourceModelPoolInterface|null $resourceModelPool
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
*/
public function __construct(
Expand All @@ -60,8 +56,7 @@ public function __construct(
\Magento\Eav\Model\ResourceModel\Helper $resourceHelper,
\Magento\Framework\Validator\UniversalFactory $universalFactory,
\Magento\Store\Model\StoreManagerInterface $storeManager,
\Magento\Framework\DB\Adapter\AdapterInterface $connection = null,
ResourceModelPoolInterface $resourceModelPool = null
\Magento\Framework\DB\Adapter\AdapterInterface $connection = null
) {
$this->_storeManager = $storeManager;
parent::__construct(
Expand All @@ -74,8 +69,7 @@ public function __construct(
$eavEntityFactory,
$resourceHelper,
$universalFactory,
$connection,
$resourceModelPool
$connection
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
use Magento\Store\Model\Store;
use Magento\Catalog\Model\Indexer\Category\Product\TableMaintainer;
use Magento\Framework\Indexer\DimensionFactory;
use Magento\Framework\Model\ResourceModel\ResourceModelPoolInterface;

/**
* Product collection
Expand All @@ -32,6 +31,7 @@
* @SuppressWarnings(PHPMD.ExcessiveClassComplexity)
* @SuppressWarnings(PHPMD.NumberOfChildren)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
* @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
* @since 100.0.2
*/
class Collection extends \Magento\Catalog\Model\ResourceModel\Collection\AbstractCollection
Expand Down Expand Up @@ -324,7 +324,6 @@ class Collection extends \Magento\Catalog\Model\ResourceModel\Collection\Abstrac
* @param TableMaintainer|null $tableMaintainer
* @param PriceTableResolver|null $priceTableResolver
* @param DimensionFactory|null $dimensionFactory
* @param ResourceModelPoolInterface|null $resourceModelPool
*
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
*/
Expand Down Expand Up @@ -353,8 +352,7 @@ public function __construct(
MetadataPool $metadataPool = null,
TableMaintainer $tableMaintainer = null,
PriceTableResolver $priceTableResolver = null,
DimensionFactory $dimensionFactory = null,
ResourceModelPoolInterface $resourceModelPool = null
DimensionFactory $dimensionFactory = null
) {
$this->moduleManager = $moduleManager;
$this->_catalogProductFlatState = $catalogProductFlatState;
Expand Down Expand Up @@ -382,8 +380,7 @@ public function __construct(
$resourceHelper,
$universalFactory,
$storeManager,
$connection,
$resourceModelPool
$connection
);
$this->tableMaintainer = $tableMaintainer ?: ObjectManager::getInstance()->get(TableMaintainer::class);
$this->priceTableResolver = $priceTableResolver ?: ObjectManager::getInstance()->get(PriceTableResolver::class);
Expand Down Expand Up @@ -1979,6 +1976,7 @@ protected function _productLimitationPrice($joinLeft = false)
}
// Set additional field filters
foreach ($this->_priceDataFieldFilters as $filterData) {
// phpcs:ignore Magento2.Functions.DiscouragedFunction
$select->where(call_user_func_array('sprintf', $filterData));
}
} else {
Expand Down Expand Up @@ -2284,6 +2282,7 @@ private function getBackend()
public function addPriceDataFieldFilter($comparisonFormat, $fields)
{
if (!preg_match('/^%s( (<|>|=|<=|>=|<>) %s)*$/', $comparisonFormat)) {
// phpcs:ignore Magento2.Exceptions.DirectThrow
throw new \Exception('Invalid comparison format.');
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,14 @@
*/
namespace Magento\Catalog\Model\ResourceModel\Product\Compare\Item;

use Magento\Catalog\Model\Indexer\Category\Product\TableMaintainer;
use Magento\Catalog\Model\Indexer\Product\Price\PriceTableResolver;
use Magento\Catalog\Model\ResourceModel\Product\Collection\ProductLimitationFactory;
use Magento\Framework\EntityManager\MetadataPool;
use Magento\Framework\Indexer\DimensionFactory;
use Magento\Framework\Model\ResourceModel\ResourceModelPoolInterface;

/**
* Catalog Product Compare Items Resource Collection
*
* @api
* @author Magento Core Team <core@magentocommerce.com>
* @SuppressWarnings(PHPMD.LongVariable)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
* @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
* @since 100.0.2
*/
class Collection extends \Magento\Catalog\Model\ResourceModel\Product\Collection
Expand Down Expand Up @@ -82,12 +76,6 @@ class Collection extends \Magento\Catalog\Model\ResourceModel\Product\Collection
* @param \Magento\Catalog\Model\ResourceModel\Product\Compare\Item $catalogProductCompareItem
* @param \Magento\Catalog\Helper\Product\Compare $catalogProductCompare
* @param \Magento\Framework\DB\Adapter\AdapterInterface $connection
* @param ProductLimitationFactory|null $productLimitationFactory
* @param MetadataPool|null $metadataPool
* @param TableMaintainer|null $tableMaintainer
* @param PriceTableResolver|null $priceTableResolver
* @param DimensionFactory|null $dimensionFactory
* @param ResourceModelPoolInterface|null $resourceModelPool
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
*/
public function __construct(
Expand All @@ -112,13 +100,7 @@ public function __construct(
\Magento\Customer\Api\GroupManagementInterface $groupManagement,
\Magento\Catalog\Model\ResourceModel\Product\Compare\Item $catalogProductCompareItem,
\Magento\Catalog\Helper\Product\Compare $catalogProductCompare,
\Magento\Framework\DB\Adapter\AdapterInterface $connection = null,
ProductLimitationFactory $productLimitationFactory = null,
MetadataPool $metadataPool = null,
TableMaintainer $tableMaintainer = null,
PriceTableResolver $priceTableResolver = null,
DimensionFactory $dimensionFactory = null,
ResourceModelPoolInterface $resourceModelPool = null
\Magento\Framework\DB\Adapter\AdapterInterface $connection = null
) {
$this->_catalogProductCompareItem = $catalogProductCompareItem;
$this->_catalogProductCompare = $catalogProductCompare;
Expand All @@ -142,13 +124,7 @@ public function __construct(
$customerSession,
$dateTime,
$groupManagement,
$connection,
$productLimitationFactory,
$metadataPool,
$tableMaintainer,
$priceTableResolver,
$dimensionFactory,
$resourceModelPool
$connection
);
}

Expand Down
Loading

0 comments on commit 06019a6

Please sign in to comment.