Ejemplo n.º 1
0
 protected function _saveWithoutResetDirty()
 {
     $insert = !is_array($this->_getPrimaryKey()) && !$this->getCleanValue($this->_getPrimaryKey());
     if ($insert) {
         $this->_beforeInsert();
     } else {
         $this->_beforeUpdate();
     }
     $this->_beforeSaveSiblingMaster();
     $this->_beforeSave();
     if ($insert || $this->_isDirty()) {
         $ret = $this->_row->save();
     } else {
         $ret = $this->{$this->_getPrimaryKey()};
     }
     parent::_saveWithoutResetDirty();
     //siblings nach uns speichern; damit auto-inc id vorhanden
     if ($insert) {
         $this->_afterInsert();
         $this->_model->afterInsert($this);
     } else {
         $this->_afterUpdate();
     }
     $this->_afterSave();
     return $ret;
 }
Ejemplo n.º 2
0
 protected function _saveWithoutResetDirty()
 {
     $this->_beforeSaveSiblingMaster();
     $this->_beforeSave();
     if ($this->_isNewRow) {
         $this->_beforeInsert();
     } else {
         $this->_beforeUpdate();
     }
     Kwf_Model_Row_Abstract::_saveWithoutResetDirty();
     if ($this->_isNewRow) {
         $this->_afterInsert();
     } else {
         $this->_afterUpdate();
     }
     $this->_afterSave();
     $this->_isNewRow = false;
 }
Ejemplo n.º 3
0
 protected function _saveWithoutResetDirty()
 {
     $this->_beforeSave();
     $id = $this->{$this->_getPrimaryKey()};
     if (!$id) {
         $this->_beforeInsert();
     } else {
         $this->_beforeUpdate();
     }
     $this->_beforeSaveSiblingMaster();
     //DEAKTIVIERT: $ret = $this->_row->save();
     //(neue row wird in Model::synchronizeAndInsertRow eingefügt)
     return Kwf_Model_Row_Abstract::_saveWithoutResetDirty();
     //nicht parent, der würde wida _row->save machen
     $this->_afterSave();
     if (!$id) {
         $this->_afterInsert();
     } else {
         $this->_afterUpdate();
     }
 }
Ejemplo n.º 4
0
 protected function _saveWithoutResetDirty()
 {
     $this->_beforeSave();
     $id = $this->getCleanValue($this->_getPrimaryKey());
     if (!$id) {
         $this->_beforeInsert();
     } else {
         $this->_beforeUpdate();
     }
     $this->_beforeSaveSiblingMaster();
     $ret = $this->_row->_saveWithoutResetDirty();
     parent::_saveWithoutResetDirty();
     $this->_afterSave();
     if (!$id) {
         $this->_afterInsert();
     } else {
         $this->_afterUpdate();
     }
     return $ret;
 }
Ejemplo n.º 5
0
 protected function _saveWithoutResetDirty()
 {
     $update = isset($this->_cleanData[$this->_getPrimaryKey()]);
     $this->_beforeSaveSiblingMaster();
     $this->_beforeSave();
     if ($update) {
         $this->_beforeUpdate();
     } else {
         $this->_beforeInsert();
     }
     if ($update) {
         if ($this->_isDirty()) {
             $ret = $this->_model->update($this, $this->_data);
         } else {
             $ret = $this->{$this->_getPrimaryKey()};
         }
     } else {
         $ret = $this->_model->insert($this, $this->_data);
         $this->_data[$this->_getPrimaryKey()] = $ret;
     }
     $this->_cleanData = $this->_data;
     parent::_saveWithoutResetDirty();
     //siblings nach uns speichern; damit auto-inc id vorhanden
     if ($update) {
         $this->_afterUpdate();
     } else {
         $this->_afterInsert();
     }
     $this->_afterSave();
     return $ret;
 }