Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
|
Public Member Functions | |
__construct (\Magento\Catalog\Model\Product\Media\Config $mediaConfig, \Magento\Framework\Filesystem $filesystem, \Magento\MediaStorage\Helper\File\Storage\Database $fileStorageDb, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Framework\Image\Factory $imageFactory, \Magento\Theme\Model\ResourceModel\Theme\Collection $themeCollection, \Magento\Framework\View\ConfigInterface $configInterface) | |
getSwatchAttributeImage ($swatchType, $file) | |
generateSwatchVariations ($imageUrl) | |
getFolderNameSize ($swatchType, $imageConfig=null) | |
getImageConfig () | |
getSwatchMediaUrl () | |
getAttributeSwatchPath ($file) | |
getSwatchMediaPath () | |
getSwatchCachePath ($swatchType) | |
![]() | |
__construct (Context $context) | |
isModuleOutputEnabled ($moduleName=null) | |
Data Fields | |
const | SWATCH_MEDIA_PATH = 'attribute/swatch' |
Protected Member Functions | |
getUniqueFileName ($file) | |
setupImageProperties (\Magento\Framework\Image $image, $isSwatch=false) | |
generateNamePath ($imageConfig, $imageUrl, $swatchType) | |
prepareFileName ($imageUrl) | |
prepareFile ($file) | |
![]() | |
_getRequest () | |
_getModuleName () | |
_getUrl ($route, $params=[]) | |
Protected Attributes | |
$mediaConfig | |
$mediaDirectory | |
$fileStorageDb = null | |
$storeManager | |
$imageFactory | |
$themeCollection | |
$viewConfig | |
$swatchImageTypes = ['swatch_image', 'swatch_thumb'] | |
![]() | |
$_moduleName | |
$_request | |
$_moduleManager | |
$_logger | |
$_urlBuilder | |
$_httpHeader | |
$_eventManager | |
$_remoteAddress | |
$urlEncoder | |
$urlDecoder | |
$scopeConfig | |
$_cacheConfig | |
Helper to move images from tmp to catalog directory @api @SuppressWarnings(PHPMD.CouplingBetweenObjects)
__construct | ( | \Magento\Catalog\Model\Product\Media\Config | $mediaConfig, |
\Magento\Framework\Filesystem | $filesystem, | ||
\Magento\MediaStorage\Helper\File\Storage\Database | $fileStorageDb, | ||
\Magento\Store\Model\StoreManagerInterface | $storeManager, | ||
\Magento\Framework\Image\Factory | $imageFactory, | ||
\Magento\Theme\Model\ResourceModel\Theme\Collection | $themeCollection, | ||
\Magento\Framework\View\ConfigInterface | $configInterface | ||
) |
\Magento\Catalog\Model\Product\Media\Config | $mediaConfig | |
\Magento\Framework\Filesystem | $filesystem | |
\Magento\MediaStorage\Helper\File\Storage\Database | $fileStorageDb | |
\Magento\Store\Model\StoreManagerInterface | $storeManager | |
\Magento\Framework\Image\Factory | $imageFactory | |
\Magento\Theme\Model\ResourceModel\Theme\Collection | $themeCollection | |
\Magento\Framework\View\ConfigInterface | $configInterface |
Definition at line 84 of file Media.php.
|
protected |
Generate swatch path and name for saving
array | $imageConfig | |
string | $imageUrl | |
string | $swatchType |
Definition at line 227 of file Media.php.
generateSwatchVariations | ( | $imageUrl | ) |
Generate swatch thumb and small swatch image
string | $imageUrl |
Definition at line 184 of file Media.php.
getAttributeSwatchPath | ( | $file | ) |
getFolderNameSize | ( | $swatchType, | |
$imageConfig = null |
|||
) |
getImageConfig | ( | ) |
Merged config from view.xml
Definition at line 257 of file Media.php.
getSwatchAttributeImage | ( | $swatchType, | |
$file | |||
) |
string | $swatchType | |
string | $file |
Definition at line 107 of file Media.php.
getSwatchCachePath | ( | $swatchType | ) |
getSwatchMediaUrl | ( | ) |
Url type http://url/pub/media/attribute/swatch/
Definition at line 288 of file Media.php.
|
protected |
Check whether file to move exists. Getting unique name
<type> | $file |
Definition at line 162 of file Media.php.
|
protected |
|
protected |
Image url /m/a/magento.png return ['name' => 'magento.png', 'path => '/m/a']
string | $imageUrl |
Definition at line 275 of file Media.php.
|
protected |
|
protected |
const SWATCH_MEDIA_PATH = 'attribute/swatch' |