Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Minsaleqty.php
Go to the documentation of this file.
1 <?php
7 
11 class Minsaleqty extends \Magento\Framework\App\Config\Value
12 {
18  protected $_catalogInventoryMinsaleqty = null;
19 
30  public function __construct(
31  \Magento\Framework\Model\Context $context,
32  \Magento\Framework\Registry $registry,
33  \Magento\Framework\App\Config\ScopeConfigInterface $config,
34  \Magento\Framework\App\Cache\TypeListInterface $cacheTypeList,
35  \Magento\CatalogInventory\Helper\Minsaleqty $catalogInventoryMinsaleqty,
36  \Magento\Framework\Model\ResourceModel\AbstractResource $resource = null,
37  \Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null,
38  array $data = []
39  ) {
40  $this->_catalogInventoryMinsaleqty = $catalogInventoryMinsaleqty;
41  parent::__construct($context, $registry, $config, $cacheTypeList, $resource, $resourceCollection, $data);
42  }
43 
49  protected function _afterLoad()
50  {
51  $value = $this->getValue();
52  $value = $this->_catalogInventoryMinsaleqty->makeArrayFieldValue($value);
53  $this->setValue($value);
54  }
55 
61  public function beforeSave()
62  {
63  $value = $this->getValue();
64  $value = $this->_catalogInventoryMinsaleqty->makeStorableArrayFieldValue($value);
65  $this->setValue($value);
66  }
67 }
__construct(\Magento\Framework\Model\Context $context, \Magento\Framework\Registry $registry, \Magento\Framework\App\Config\ScopeConfigInterface $config, \Magento\Framework\App\Cache\TypeListInterface $cacheTypeList, \Magento\CatalogInventory\Helper\Minsaleqty $catalogInventoryMinsaleqty, \Magento\Framework\Model\ResourceModel\AbstractResource $resource=null, \Magento\Framework\Data\Collection\AbstractDb $resourceCollection=null, array $data=[])
Definition: Minsaleqty.php:30
$config
Definition: fraud_order.php:17
$resource
Definition: bulk.php:12
$value
Definition: gender.phtml:16