/** * 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; }
/** * 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(); }
/** * 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; }