public function run() { if (!empty($_GET[$this->prefix . 'delete']) && $this->delete) { $cond = $this->condition . db()->format(" AND `{$this->pk}` = '%s'", $_GET[$this->prefix . 'delete']); $this->table->del($cond); return true; } if (!empty($_GET[$this->prefix . 'update']) && $this->edit) { $cond = $this->condition . db()->format(" AND `{$this->pk}` = '%s'", $_GET[$this->prefix . 'update']); $this->table->update($this->validate('edit'), $cond); return true; } if (isset($_GET[$this->prefix . 'create']) && $this->create) { $this->table->insert($this->validate('create')); return true; } return false; }
public function set($cat, $key, $value) { $this->table->insert(array('category' => $cat, 'name' => $key, 'value' => $value), 'REPLACE'); }