|
@@ -14,18 +14,6 @@ class DescriptionModel
|
|
|
$this->pdo->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION);
|
|
$this->pdo->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public function getDescriptionsByCompany(int $companyId): array
|
|
|
|
|
-{
|
|
|
|
|
- $stmt = $this->pdo->prepare("
|
|
|
|
|
- SELECT d.description_id, d.description_text, d.product_id
|
|
|
|
|
- FROM description d
|
|
|
|
|
- WHERE d.company_id = :company_id
|
|
|
|
|
- ");
|
|
|
|
|
- $stmt->execute(['company_id' => $companyId]);
|
|
|
|
|
-
|
|
|
|
|
- return $stmt->fetchAll(\PDO::FETCH_ASSOC);
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
public function addDescription(int $productId, int $companyId, string $text): bool
|
|
public function addDescription(int $productId, int $companyId, string $text): bool
|
|
|
{
|
|
{
|
|
|
$stmt = $this->pdo->prepare("
|
|
$stmt = $this->pdo->prepare("
|