public function update($table = '', $set = NULL, $where = NULL, $limit = NULL)
{
// Combine any cached components with the current statements
$this->_merge_cache();
if ($set !== NULL) {
$this->set($set);
}
if ($this->_validate_update($table) === FALSE) {
return FALSE;
}
if ($where !== NULL) {
$this->where($where);
}
if (!empty($limit)) {
$this->limit($limit);
}
$sql = $this->_update($this->qb_from[0], $this->qb_set);
$this->_reset_write();
return $this->query($sql);
}
public function update($id, array $data) { $data = $this->check_fields($data); if (array_key_exists('updated', $this->table_fields)) { $date['updated'] = date('Y-m-d H:i:s'); } return $this->db->update($this->table, $data, ['id' => $id]); }