pdo = new \PDO("sqlite:" . $dbPath); $this->pdo->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION); } public function addDescription(int $productId, int $companyId, string $text): bool { $stmt = $this->pdo->prepare(" INSERT INTO description (description_text, product_id, company_id) VALUES (:text, :product_id, :company_id) "); return $stmt->execute([ 'text' => $text, 'product_id' => $productId, 'company_id' => $companyId, ]); } public function updateDescription(int $productId, int $companyId, string $text): bool { $stmt = $this->pdo->prepare("UPDATE description SET description_text = :text WHERE product_id = :product_id AND company_id = :company_id"); return $stmt->execute([ 'text' => $text, 'product_id' => $productId, 'company_id' => $companyId, ]); } }