예제 #1
0
파일: Minqty.php 프로젝트: aiesh/magento2
 /**
  * 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
파일: Theme.php 프로젝트: aiesh/magento2
 /**
  * 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;
 }