Beispiel #1
0
 public function save()
 {
     if ($this->__recordset !== null) {
         if ($this->__records_id === null) {
             $rec = $this->__recordset->new_record($this->values());
             if ($rec === null) {
                 return false;
             }
             $this->__records_id = $this->id = $rec->id;
             $this->_active = $rec->_active;
             $this->created_by = $rec->created_by;
             return true;
         } else {
             return $this->__recordset->update_record($this->__records_id, $this->values());
         }
     } else {
         trigger_error('Trying to save record that was not linked to proper recordset', E_USER_ERROR);
     }
     return false;
 }