You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
SAE4.01_FORMULAIRE/Source/API/script/Gateway/GatewayKeyword.php

41 lines
942 B

<?php
namespace API\script\Gateway;
use API\script\Config\Connection;
use BusinessClass\Keyword;
use PDO;
class GatewayKeyword
{
private Connection $connection;
public function __construct()
{
$this->connection = connect();
}
public function insertKeyword(string $word): void
{
$query = "INSERT INTO Keyword(word) VALUES(:word)";
$this->connection->executeQuery($query, array(
':word' => array($word, PDO::PARAM_STR)
));
}
public function deleteKeyword(string $word): void
{
$query = "DELETE FROM Keyword WHERE word = :word";
$this->connection->executeQuery($query, array(
':word' => array($word, PDO::PARAM_STR)
));
}
public function getAllKeyword(): array
{
$query = "SELECT * FROM Keyword";
$this->connection->executeQuery($query);
return $this->connection->getResults();
}
}