86 $this->fileFullPath =
null;
87 $this->fileRelativePath =
null;
90 if ($this->fileFullPath ===
null) {
94 $validatorChain = $this->validateFactory->create();
102 if ($validatorChain->isValid($this->fileFullPath,
$optionValue[
'title'])) {
103 $result = $this->rootDirectory->isReadable($this->fileRelativePath)
106 }
elseif ($validatorChain->getErrors()) {
110 throw new \Magento\Framework\Exception\LocalizedException(
__(implode(
"\n",
$errors)));
113 throw new \Magento\Framework\Exception\LocalizedException(
114 __(
"The product's required option(s) weren't entered. Make sure the options are entered and try again.")
149 if (isset(
$optionValue[
'order_path']) && !$this->useQuotePath) {
153 foreach ($checkPaths as
$path) {
154 if (!$this->rootDirectory->isFile(
$path)) {
155 if (!$this->coreFileStorageDatabase->saveFileToFilesystem(
$path)) {
159 $this->fileFullPath = $this->rootDirectory->getAbsolutePath(
$path);
160 $this->fileRelativePath =
$path;
buildSecretKey($fileRelativePath)
getValidatorErrors($errors, $fileInfo, $option)
initFilePath($optionValue)
elseif(isset( $params[ 'redirect_parent']))
validate($optionValue, $option)
buildImageValidator($object, $option, $fileFullPath=null)
__construct(\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Framework\Filesystem $filesystem, \Magento\Framework\File\Size $fileSize, \Magento\MediaStorage\Helper\File\Storage\Database $coreFileStorageDatabase, \Magento\Catalog\Model\Product\Option\Type\File\ValidateFactory $validateFactory)
setUseQuotePath($useQuotePath)