table = Db::prefix() . 'rsv_form_submit'; } public function add(int $form_id, array $values): int { return Db::insert($this->table, [ 'form_id' => $form_id, 'values' => json_encode($values), ]); } public function delete(int $id): void { Db::delete($this->table, ['form_submit_id' => $id]); } public function get(int $id): ?array { $row = Db::get_row( "SELECT * FROM {$this->table} WHERE form_submit_id = %d", [$id], ARRAY_A ); if ($row === null) { return null; } $row['values'] = json_decode($row['values'], true); return $row; } }