remove redundant code

git-svn-id: file:///home/shish/svn/shimmie2/trunk@628 7f39781d-f577-437e-ae19-be835c7a54ca
This commit is contained in:
shish 2007-12-06 10:47:09 +00:00
parent 87c31f432b
commit 60e89ef893

View File

@ -10,14 +10,11 @@ class Config {
public function save($name=null) {
if(is_null($name)) {
foreach($this->values as $name => $value) {
// does "or update" work with sqlite / postgres?
$this->database->db->StartTrans();
$this->database->Execute("DELETE FROM config WHERE name = ?", array($name));
$this->database->Execute("INSERT INTO config VALUES (?, ?)", array($name, $value));
$this->database->db->CommitTrans();
$this->save($name);
}
}
else {
// does "or update" work with sqlite / postgres?
$this->database->db->StartTrans();
$this->database->Execute("DELETE FROM config WHERE name = ?", array($name));
$this->database->Execute("INSERT INTO config VALUES (?, ?)", array($name, $this->values[$name]));