@@ -178,7 +178,7 @@ class Sitemap extends \Magento\Framework\Model\AbstractModel implements \Magento
178
178
/**
179
179
* Sitemap Item Factory
180
180
*
181
- * @var SitemapItemInterfaceFactory|null
181
+ * @var \Magento\Sitemap\Model\ SitemapItemInterfaceFactory
182
182
*/
183
183
private $ sitemapItemFactory ;
184
184
@@ -203,7 +203,7 @@ class Sitemap extends \Magento\Framework\Model\AbstractModel implements \Magento
203
203
* @param DocumentRoot|null $documentRoot
204
204
* @param ItemResolverInterface|null $itemResolver
205
205
* @param SitemapConfigReaderInterface|null $configReader
206
- * @param SitemapItemInterfaceFactory|null $sitemapItemFactory
206
+ * @param \Magento\Sitemap\Model\ SitemapItemInterfaceFactory|null $sitemapItemFactory
207
207
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
208
208
*/
209
209
public function __construct (
@@ -225,12 +225,11 @@ public function __construct(
225
225
\Magento \Config \Model \Config \Reader \Source \Deployed \DocumentRoot $ documentRoot = null ,
226
226
ItemResolverInterface $ itemResolver = null ,
227
227
SitemapConfigReaderInterface $ configReader = null ,
228
- SitemapItemInterfaceFactory $ sitemapItemFactory = null
228
+ \ Magento \ Sitemap \ Model \ SitemapItemInterfaceFactory $ sitemapItemFactory = null
229
229
) {
230
- $ objectManager = ObjectManager::getInstance ();
231
230
$ this ->_escaper = $ escaper ;
232
231
$ this ->_sitemapData = $ sitemapData ;
233
- $ documentRoot = $ documentRoot ?: $ objectManager ->get (DocumentRoot::class);
232
+ $ documentRoot = $ documentRoot ?: ObjectManager:: getInstance () ->get (DocumentRoot::class);
234
233
$ this ->_directory = $ filesystem ->getDirectoryWrite ($ documentRoot ->getPath ());
235
234
$ this ->_categoryFactory = $ categoryFactory ;
236
235
$ this ->_productFactory = $ productFactory ;
@@ -239,9 +238,11 @@ public function __construct(
239
238
$ this ->_storeManager = $ storeManager ;
240
239
$ this ->_request = $ request ;
241
240
$ this ->dateTime = $ dateTime ;
242
- $ this ->itemResolver = $ itemResolver ?: $ objectManager ->get (ItemResolverInterface::class);
243
- $ this ->configReader = $ configReader ?: $ objectManager ->get (SitemapConfigReaderInterface::class);
244
- $ this ->sitemapItemFactory = $ sitemapItemFactory ?: $ objectManager ->get (SitemapItemInterfaceFactory::class);
241
+ $ this ->itemResolver = $ itemResolver ?: ObjectManager::getInstance ()->get (ItemResolverInterface::class);
242
+ $ this ->configReader = $ configReader ?: ObjectManager::getInstance ()->get (SitemapConfigReaderInterface::class);
243
+ $ this ->sitemapItemFactory = $ sitemapItemFactory ?: ObjectManager::getInstance ()->get (
244
+ \Magento \Sitemap \Model \SitemapItemInterfaceFactory::class
245
+ );
245
246
parent ::__construct ($ context , $ registry , $ resource , $ resourceCollection , $ data );
246
247
247
248
}
0 commit comments