public function toArray()
 {
     $ret = parent::toArray();
     foreach ($this->_model->getOwnColumns() as $c) {
         $ret[$c] = $this->{$c};
     }
     return $ret;
 }
Example #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;
 }
Example #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();
     }
 }
 public function __construct(array $config)
 {
     $this->_data = $config['data'];
     parent::__construct($config);
 }
Example #5
0
 public function toArray()
 {
     $ret = array_merge(parent::toArray(), $this->_row->toArray());
     return $ret;
 }
Example #6
0
 protected function _afterSave()
 {
     parent::_afterSave();
     Kwf_Component_Data_Root::reset();
     Kwf_Component_Generator_Abstract::clearInstances();
 }
 public function delete()
 {
     parent::delete();
     if ($this->_model->hasDeletedFlag()) {
         $this->_beforeDelete();
         $this->deleted = true;
         $this->save();
         $this->_afterDelete();
     } else {
         $this->_beforeDelete();
         $id = $this->{$this->_getPrimaryKey()};
         $this->_model->delete($this);
         $this->_afterDelete();
         $this->_data = array_combine(array_keys($this->_data), array_fill(0, count($this->_data), null));
     }
 }
Example #8
0
 public function toArray()
 {
     $ret = array();
     $mapping = $this->_model->getUnionColumnMapping();
     $columns = get_class_vars($mapping);
     foreach ($columns['columns'] as $c) {
         $name = $this->_sourceRow->getModel()->getColumnMapping($mapping, $c);
         if ($name) {
             $ret[$c] = $this->_sourceRow->{$name};
         } else {
             $ret[$c] = null;
         }
     }
     $ret = array_merge($ret, parent::toArray());
     $ret['id'] = $this->_id;
     return $ret;
 }
 public function __construct(Kwf_Model_Row_Abstract $row)
 {
     $this->class = $row->getModel()->getFactoryId();
     $this->row = $row;
 }