From 0913b3bf822a58ec93b34a9aea8d6ee4d6464e9b Mon Sep 17 00:00:00 2001 From: Alexis Date: Tue, 31 Jan 2023 19:07:05 +0100 Subject: [PATCH] Merge script database --- Source/API/script/Gateway/Connection.php | 37 ------------------- Source/API/script/Gateway/GatewayForm.php | 4 +- Source/API/script/Gateway/GatewayKeyword.php | 3 ++ Source/API/script/Gateway/GatewayQuestion.php | 5 ++- .../{Category.php => Keyword.php} | 2 +- Source/Config/config.php | 4 -- 6 files changed, 10 insertions(+), 45 deletions(-) delete mode 100644 Source/API/script/Gateway/Connection.php rename Source/BusinessClass/{Category.php => Keyword.php} (96%) diff --git a/Source/API/script/Gateway/Connection.php b/Source/API/script/Gateway/Connection.php deleted file mode 100644 index 768245b..0000000 --- a/Source/API/script/Gateway/Connection.php +++ /dev/null @@ -1,37 +0,0 @@ -setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); - } - - - /** * @param string $query - * @param array $parameters * - * @return bool Returns `true` on success, `false` otherwise - */ - public function executeQuery(string $query, array $parameters = []): bool - { - $this->stmt = parent::prepare($query); - foreach ($parameters as $name => $value) { - $this->stmt->bindValue($name, $value[0], $value[1]); - } - - return $this->stmt->execute(); - } - - public function getResults(): array - { - return $this->stmt->fetchall(); - - } -} \ No newline at end of file diff --git a/Source/API/script/Gateway/GatewayForm.php b/Source/API/script/Gateway/GatewayForm.php index 208a3a7..88d8c30 100644 --- a/Source/API/script/Gateway/GatewayForm.php +++ b/Source/API/script/Gateway/GatewayForm.php @@ -2,7 +2,9 @@ namespace API\Gateway; -use FORM_BusinessClass\Question; +use BusinessClass\Keyword; +use Connection; +use BusinessClass\Question; use PDO; class GatewayForm diff --git a/Source/API/script/Gateway/GatewayKeyword.php b/Source/API/script/Gateway/GatewayKeyword.php index f1815f2..4315ada 100644 --- a/Source/API/script/Gateway/GatewayKeyword.php +++ b/Source/API/script/Gateway/GatewayKeyword.php @@ -2,6 +2,9 @@ namespace API\Gateway; +use BusinessClass\Keyword; +use Connection; + class GatewayKeyword { private Connection $connection; diff --git a/Source/API/script/Gateway/GatewayQuestion.php b/Source/API/script/Gateway/GatewayQuestion.php index dc87851..b710923 100644 --- a/Source/API/script/Gateway/GatewayQuestion.php +++ b/Source/API/script/Gateway/GatewayQuestion.php @@ -2,8 +2,9 @@ namespace API\Gateway; -use FORM_BusinessClass\BoxQuestion; -use FORM_BusinessClass\Question; +use Connection; +use BusinessClass\BoxQuestion; +use BusinessClass\Question; use PDO; class GatewayQuestion diff --git a/Source/BusinessClass/Category.php b/Source/BusinessClass/Keyword.php similarity index 96% rename from Source/BusinessClass/Category.php rename to Source/BusinessClass/Keyword.php index 52f45d5..320b5c9 100644 --- a/Source/BusinessClass/Category.php +++ b/Source/BusinessClass/Keyword.php @@ -2,7 +2,7 @@ namespace BusinessClass; -class Category +class Keyword { private string $word; diff --git a/Source/Config/config.php b/Source/Config/config.php index a805314..a36c020 100644 --- a/Source/Config/config.php +++ b/Source/Config/config.php @@ -3,9 +3,5 @@ $rep = __DIR__ . '/../'; -$base=""; -$login=""; -$password=""; - // Vues $views['form'] = 'Views/HTML/form.php';