Пример #1
0
 /**
  * 
  * Modify the current record before it is updated into the DB.
  * 
  * @return void
  * 
  */
 protected function _modUpdate()
 {
     // force the 'updated' value
     $col = $this->_model->updated_col;
     if ($col) {
         $this->{$col} = date('Y-m-d H:i:s');
     }
     // if inheritance is turned on, auto-set the inheritance value
     if ($this->_model->isInherit()) {
         $col = $this->_model->inherit_col;
         $this->{$col} = $this->_model->inherit_name;
     }
     // auto-set sequences where keys exist and values are empty
     foreach ($this->_model->sequence_cols as $col => $val) {
         if (array_key_exists($col, $this->_data) && empty($this->{$col})) {
             // key is present but no value is given.
             // add a new sequence value.
             $this->{$col} = $this->_model->sql->nextSequence($val);
         }
     }
 }