37 private $contentType =
'image';
70 $this->context = $context;
71 $this->scopeConfig = $scopeConfig;
72 $this->assetRepo = $assetRepo;
84 $result = $this->assetRepo->getUrl(
"Magento_Catalog::images/product/placeholder/{$this->type}.jpg");
95 return $this->contentType;
105 . DIRECTORY_SEPARATOR . $this->
getModule()
108 $defaultPlaceholder = $this->assetRepo->createAsset(
109 "Magento_Catalog::images/product/placeholder/{$this->type}.jpg" 112 $result = $defaultPlaceholder->getSourceFile();
136 return $this->contentType;
152 if ($this->filePath !==
null) {
153 return $this->filePath;
156 $isConfigPlaceholder = $this->scopeConfig->getValue(
157 "catalog/placeholder/{$this->type}_placeholder",
158 \
Magento\Store\Model\ScopeInterface::SCOPE_STORE
160 $this->filePath = $isConfigPlaceholder;
162 return $this->filePath;
171 return $this->context;
179 return 'placeholder';
__construct(ContextInterface $context, ScopeConfigInterface $scopeConfig, Repository $assetRepo, $type)