64 \
Magento\Framework\View\
Design\
Theme\Customization\FileServiceFactory $fileServiceFactory,
69 $this->_themeFactory = $themeFactory;
70 $this->_fileServiceFactory = $fileServiceFactory;
91 $this->_fileService = $fileService;
103 if (!$this->_fileService && $this->
hasData(
'file_type')) {
104 $this->_fileService = $this->_fileServiceFactory->create($this->
getData(
'file_type'));
105 }
elseif (!$this->_fileService) {
106 throw new \UnexpectedValueException(
'Type of file is empty');
117 $this->
setData(
'theme_id', $theme->getId());
118 $this->
setData(
'theme_path', $theme->getThemePath());
129 $theme = $this->_themeFactory->create($this->
getData(
'theme_id'));
131 throw new \Magento\Framework\Exception\LocalizedException(
__(
'Theme id should be set'));
150 return $this->
getData(
'file_name') ?: basename($this->
getData(
'file_path'));
166 return $this->
getData(
'content');
175 'id' => $this->
getId(),
177 'temporary' => $this->
getData(
'is_temporary') ? $this->
getId() : 0
189 $fileService->prepareFile($this);
190 $fileService->save($this);
191 return parent::beforeSave();
202 $fileService->delete($this);
203 return parent::beforeDelete();
setTheme(\Magento\Framework\View\Design\ThemeInterface $theme)
getCustomizationService()
setData($key, $value=null)
getData($key='', $index=null)
elseif(isset( $params[ 'redirect_parent']))
__construct(\Magento\Framework\Model\Context $context, \Magento\Framework\Registry $registry, \Magento\Framework\View\Design\Theme\FlyweightFactory $themeFactory, \Magento\Framework\View\Design\Theme\Customization\FileServiceFactory $fileServiceFactory, \Magento\Framework\Model\ResourceModel\AbstractResource $resource=null, \Magento\Framework\Data\Collection\AbstractDb $resourceCollection=null, array $data=[])
setCustomizationService(CustomizationFileInterface $fileService)