public function insertRecord($recArr) { foreach ($this->fields as $field) { if (isset($recArr[$field])) { $datetime = explode(' ', $recArr[$field]); $date = explode('-', $datetime[0]); $time = explode(':', $datetime[1]); $recArr[$field] = mktime((int) $time[0], (int) $time[1], (int) $time[2], (int) $date[1], (int) $date[2], (int) $date[0]); } } return parent::insertRecord($recArr); }
/** * Save record. This function calls {@link BizDataObj::updateRecord} method internally * * @return boolean true for success */ public function save() { if (count($this->oldVarValue) > 0) { $ok = $this->bizDataObj->updateRecord($this->varValue, $this->oldVarValue); } else { $ok = $this->bizDataObj->insertRecord($this->varValue); } // repopulate current record with bizdataobj activerecord if ($ok) { $this->varValue = $this->bizDataObj->getActiveRecord(); $this->oldVarValue = $this->varValue; } return $ok; }
/** * Save record. This function calls {@link BizDataObj::updateRecord} method internally * * @return boolean true for success */ public function save() { if (count($this->m_var_old) > 0) { $ok = $this->m_BizObj->updateRecord($this->m_var, $this->m_var_old); } else { $ok = $this->m_BizObj->insertRecord($this->m_var); } // repopulate current record with bizdataobj activerecord if ($ok) { $this->m_var = $this->m_BizObj->getActiveRecord(); $this->m_var_old = $this->m_var; } return $ok; }
public function insertRecord($recArr) { $oflags = $recArr['flags_other']; if ($recArr['flags'][0] == ",") { $recArr['flags'] = "00"; } $inactive = "0"; $probing = "0"; if (strlen($recArr['flags']) > 0) { $sflagsArr = explode(",", $recArr['flags']); $inactive = array_search("1", $sflagsArr) !== FALSE ? "1" : "0"; $probing = array_search("2", $sflagsArr) !== FALSE ? "1" : "0"; } $sflags = $probing . $inactive; $recArr['flags'] = (string) (bindec($oflags) | bindec($sflags)); $attributes = explode(',', $recArr['attrs']); if (strlen($attributes[0]) == 0) { $recArr['attrs'] = ''; } else { if (strlen($attributes[1]) > 0) { $recArr['attrs'] = str_replace(',', '=', $recArr['attrs']); $recArr['attrs'] .= ';'; } else { $recArr['attrs'] = $attributes[0] . '=0;'; } } $recArr['attrs'] .= $recArr['attrs_other']; if (substr($recArr['attrs'], -1) == ';') { $recArr['attrs'] = substr($recArr['attrs'], 0, -1); } return parent::insertRecord($recArr); }