示例#1
0
 protected function _beforeSave()
 {
     parent::_beforeSave();
     if (!$this->component) {
         throw new Kwf_Exception("component can not be empty");
     }
 }
示例#2
0
 protected function _beforeSave()
 {
     parent::_beforeSave();
     if (is_null($this->filename)) {
         $fRow = $this->getParentRow('File');
         if ($fRow) {
             $filter = new Kwf_Filter_Ascii();
             $this->filename = $filter->filter($fRow->filename);
         }
     }
 }
 protected function _beforeSave()
 {
     parent::_beforeSave();
     if (!empty($this->_changedPasswordData['password1']) && !empty($this->_changedPasswordData['password2'])) {
         if ($this->_changedPasswordData['password1'] == $this->_changedPasswordData['password2']) {
             $this->setPassword($this->_changedPasswordData['password1']);
         } else {
             throw new Kwf_ClientException(trlKwf('Passwords are different - please try again'));
         }
     }
 }
示例#4
0
 protected function _beforeSave()
 {
     parent::_beforeSave();
     $pk = $this->getModel()->getPrimaryKey();
     $sourceRow = $this->getModel()->getSourceModel()->getRow($this->{$pk});
     foreach ($this->getProxiedRow()->toArray() as $k => $i) {
         if ($sourceRow->getModel()->hasColumn($k)) {
             $sourceRow->{$k} = $i;
         }
     }
     $sourceRow->save();
     //daten von sourceRow übernehmen wie zB auto_increment
     foreach ($sourceRow->toArray() as $k => $i) {
         $this->getProxiedRow()->{$k} = $i;
     }
 }