function where($key, $value = NULL, $escape = TRUE) { return $this->_where($key, $value, 'AND ', $escape); }
/** * The actual function used for updating or interting a record * * @return bool */ private final function _save_row() { //First run validation, and bail out if it fails if ($this->validate() == FALSE) { return FALSE; } $this->_set_row(); if ($this->_isnew) { $this->db->insert($this->_table()); $this->_data[$this->_id()] = $this->db->insert_id(); $Return = $this->id() != NULL; if ($Return == true) { $this->_isnew = false; $Record = new stdClass(); foreach ($this->_data as $K => $V) { $Record->{$K} = $V; } $this->_original_record = $Record; } return $Return; } else { $this->db->where($this->_id(), $this->id()); $this->db->update($this->_forged_join()); //Just in case a join has been forged $this->_clear_forged_join(); if ($this->_record_is_changed()) { return $this->db->affected_rows() > 0; } return true; } }