|
10 | 10 |
|
11 | 11 | use Magento\CatalogUrlRewrite\Model\ProductUrlRewriteGenerator;
|
12 | 12 | use Magento\Store\Model\Store;
|
| 13 | +use Magento\Framework\App\ObjectManager; |
13 | 14 |
|
14 | 15 | /**
|
15 | 16 | * Sitemap resource product collection model
|
16 | 17 | *
|
17 |
| - * @author Magento Core Team <core@magentocommerce.com> |
18 | 18 | * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
|
19 |
| - * @SuppressWarnings(PHPMD.LongVariable) |
20 |
| - * @SuppressWarnings(PHPMD.CamelCasePropertyName) |
21 |
| - * @SuppressWarnings(PHPMD.CamelCaseMethodName) |
22 | 19 | */
|
23 | 20 | class Product extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb
|
24 | 21 | {
|
@@ -84,12 +81,12 @@ class Product extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb
|
84 | 81 | /**
|
85 | 82 | * @var \Magento\Catalog\Model\Product
|
86 | 83 | */
|
87 |
| - protected $productModel; |
| 84 | + private $productModel; |
88 | 85 |
|
89 | 86 | /**
|
90 | 87 | * @var \Magento\Catalog\Helper\Image
|
91 | 88 | */
|
92 |
| - protected $catalogImageHelper; |
| 89 | + private $catalogImageHelper; |
93 | 90 |
|
94 | 91 | /**
|
95 | 92 | * @param \Magento\Framework\Model\ResourceModel\Db\Context $context
|
@@ -128,8 +125,9 @@ public function __construct(
|
128 | 125 | $this->mediaGalleryReadHandler = $mediaGalleryReadHandler;
|
129 | 126 | $this->_mediaConfig = $mediaConfig;
|
130 | 127 | $this->_sitemapData = $sitemapData;
|
131 |
| - $this->productModel = $productModel ?: \Magento\Framework\App\ObjectManager::getInstance()->get(\Magento\Catalog\Model\Product::class); |
132 |
| - $this->catalogImageHelper = $catalogImageHelper ?: \Magento\Framework\App\ObjectManager::getInstance()->get(\Magento\Catalog\Helper\Image::class); |
| 128 | + $this->productModel = $productModel ?: ObjectManager::getInstance()->get(\Magento\Catalog\Model\Product::class); |
| 129 | + $this->catalogImageHelper = $catalogImageHelper ?: ObjectManager::getInstance() |
| 130 | + ->get(\Magento\Catalog\Helper\Image::class); |
133 | 131 | parent::__construct($context, $connectionName);
|
134 | 132 | }
|
135 | 133 |
|
|
0 commit comments