public function save() { $db = App::db(); $query = new QueryBuilder($db); if ($this->primaryKey) { $query->update($this->_tableName, $this->primaryKey, $this->_attributes); } else { $query->insert($this->_tableName, $this->_attributes); } }
public function update() { $query = new QueryBuilder(); $query->update($this->_tableName, $this->_primaryKey, $this->_attributes); }