Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Data.php
Go to the documentation of this file.
1 <?php
8 
16 {
20  const XML_PATH_EXPORT_LOCAL_VALID_PATH = 'general/file/importexport_local_valid_paths';
21 
22  const XML_PATH_BUNCH_SIZE = 'general/file/bunch_size';
23 
27  protected $_fileSize;
28 
33  public function __construct(
34  \Magento\Framework\App\Helper\Context $context,
35  \Magento\Framework\File\Size $fileSize
36  ) {
37  $this->_fileSize = $fileSize;
38  parent::__construct(
39  $context
40  );
41  }
42 
48  public function getMaxUploadSizeMessage()
49  {
50  $maxImageSize = $this->_fileSize->getMaxFileSizeInMb();
51  if ($maxImageSize) {
52  $message = __('Make sure your file isn\'t more than %1M.', $maxImageSize);
53  } else {
54  $message = __('We can\'t provide the upload settings right now.');
55  }
56  return $message;
57  }
58 
64  public function getLocalValidPaths()
65  {
66  $paths = $this->scopeConfig->getValue(
67  self::XML_PATH_EXPORT_LOCAL_VALID_PATH,
68  \Magento\Store\Model\ScopeInterface::SCOPE_STORE
69  );
70  return $paths;
71  }
72 
78  public function getBunchSize()
79  {
80  return (int)$this->scopeConfig->getValue(
81  self::XML_PATH_BUNCH_SIZE,
82  \Magento\Store\Model\ScopeInterface::SCOPE_STORE
83  );
84  }
85 }
__construct(\Magento\Framework\App\Helper\Context $context, \Magento\Framework\File\Size $fileSize)
Definition: Data.php:33
__()
Definition: __.php:13
$message
$paths
Definition: _bootstrap.php:83