db = $db; } public function elementDelete($elementId) { return $this->db->delete('pp_seo_additional', ['id' => (int)$elementId]); } public function elementSave($id, $url, $status, $title, $keywords, $description, $text) { if (!$id) { if ($this->db->insert('pp_seo_additional', [ 'url' => $url, 'status' => $status == 'on' ? 1 : 0, 'title' => $title, 'keywords' => $keywords, 'description' => $description, 'text' => $text ])) { \S::delete_cache(); return $this->db->id(); } } else { $this->db->update('pp_seo_additional', [ 'url' => $url, 'status' => $status == 'on' ? 1 : 0, 'title' => $title, 'keywords' => $keywords, 'description' => $description, 'text' => $text ], [ 'id' => (int)$id ]); \S::delete_cache(); return $id; } } public function elementDetails($elementId) { return $this->db->get('pp_seo_additional', '*', ['id' => (int)$elementId]); } }