Пример #1
0
 /**
  * Validate minimum product qty value
  *
  * @return $this
  */
 protected function _beforeSave()
 {
     parent::_beforeSave();
     $minQty = (int) $this->getValue() >= 0 ? (int) $this->getValue() : (int) $this->getOldValue();
     $this->setValue((string) $minQty);
     return $this;
 }
Пример #2
0
 /**
  * Validate specified value against frontend area
  *
  * @return $this
  */
 protected function _beforeSave()
 {
     if ('' != $this->getValue()) {
         $design = clone $this->_design;
         $design->setDesignTheme($this->getValue(), \Magento\Framework\App\Area::AREA_FRONTEND);
     }
     return parent::_beforeSave();
 }
Пример #3
0
 /**
  * Validate expiration period value before saving
  *
  * @return $this
  */
 protected function _beforeSave()
 {
     parent::_beforeSave();
     $expirationPeriod = (int) $this->getValue();
     if ($expirationPeriod < 1) {
         $expirationPeriod = (int) $this->getOldValue();
     }
     $this->setValue((string) $expirationPeriod);
     return $this;
 }