Ejemplo n.º 1
0
 protected function _beforeUpdate()
 {
     parent::_beforeUpdate();
     if (in_array('filename', $this->getDirtyColumns())) {
         $model = Kwf_Component_Data_Root::getInstance()->getComponentByDbId($this->component_id, array('ignoreVisible' => true))->generator->getHistoryModel();
         $data = array('component_id' => $this->component_id, 'filename' => $this->getCleanValue('filename'));
         $row = $model->createRow($data);
         $row->save();
     }
 }
Ejemplo n.º 2
0
 protected function _beforeUpdate()
 {
     parent::_beforeUpdate();
     if ($this->_doSyncOnUpdate) {
         //$this->_row->toArray() statt $this->toArray() da sonst sibling felder zuviel dabei sind
         $data = $this->_row->toArray();
         $returnedData = $this->getModel()->synchronizeAndUpdateRow($data);
         foreach ($returnedData as $k => $v) {
             //parent aufrufen da die primaryKey exception ignoriert werden soll
             //und doSynOnUpdate nicht benötigt wird
             parent::__set($k, $v);
         }
         $this->_doSyncOnUpdate = false;
     }
 }
Ejemplo n.º 3
0
 protected function _beforeUpdate()
 {
     parent::_beforeUpdate();
     if ($this->_changedOldMail) {
         if (Kwf_Registry::get('userModel')->mailExists($this->email)) {
             throw new Kwf_ClientException(trlKwf('An account with this email address already exists'));
         }
         $this->sendChangedMailMail($this->_changedOldMail);
     }
     if ($this->_sendDeletedMail) {
         $this->sendDeletedMail();
     }
     if ($this->_saveDeletedLog) {
         $this->writeLog('user_deleted');
         $this->_saveDeletedLog = false;
     }
 }