7
7
8
8
namespace Magento \CatalogGraphQl \Model \Resolver \Products \DataProvider \Image ;
9
9
10
- use Magento \CatalogGraphQl \Model \Resolver \Products \DataProvider \Image \Placeholder \Theme ;
11
10
use Magento \Catalog \Model \View \Asset \PlaceholderFactory ;
12
11
use Magento \Framework \View \Asset \Repository as AssetRepository ;
13
12
@@ -26,33 +25,24 @@ class Placeholder
26
25
*/
27
26
private $ assetRepository ;
28
27
29
- /**
30
- * @var Theme
31
- */
32
- private $ theme ;
33
-
34
28
/**
35
29
* Placeholder constructor.
36
30
* @param PlaceholderFactory $placeholderFactory
37
31
* @param AssetRepository $assetRepository
38
- * @param Theme $theme
39
32
*/
40
33
public function __construct (
41
34
PlaceholderFactory $ placeholderFactory ,
42
- AssetRepository $ assetRepository ,
43
- Theme $ theme
35
+ AssetRepository $ assetRepository
44
36
) {
45
37
$ this ->placeholderFactory = $ placeholderFactory ;
46
38
$ this ->assetRepository = $ assetRepository ;
47
- $ this ->theme = $ theme ;
48
39
}
49
40
50
41
/**
51
42
* Get placeholder
52
43
*
53
44
* @param string $imageType
54
45
* @return string
55
- * @throws \Magento\Framework\Exception\NoSuchEntityException
56
46
*/
57
47
public function getPlaceholder (string $ imageType ): string
58
48
{
@@ -63,10 +53,8 @@ public function getPlaceholder(string $imageType): string
63
53
return $ imageAsset ->getUrl ();
64
54
}
65
55
66
- $ themeData = $ this ->theme ->getThemeData ();
67
- return $ this ->assetRepository ->createAsset (
68
- "Magento_Catalog::images/product/placeholder/ {$ imageType }.jpg " ,
69
- $ themeData
70
- )->getUrl ();
56
+ return $ this ->assetRepository ->getUrl (
57
+ "Magento_Catalog::images/product/placeholder/ {$ imageType }.jpg "
58
+ );
71
59
}
72
60
}
0 commit comments