diff --git a/Source/API/script/Gateway/GatewayQuestion.php b/Source/API/script/Gateway/GatewayQuestion.php index 45f7bbe..ebf57fb 100644 --- a/Source/API/script/Gateway/GatewayQuestion.php +++ b/Source/API/script/Gateway/GatewayQuestion.php @@ -2,9 +2,9 @@ namespace API\Gateway; -use API\PDO; use FORM_BusinessClass\BoxQuestion; use FORM_BusinessClass\Question; +use PDO; class GatewayQuestion { @@ -58,4 +58,17 @@ class GatewayQuestion } } } + + public function updateQuestion(Question $question){ + $query = "UPDATE Question SET content = :content, type = :type, form = :form WHERE id = :id"; + $this->connection->executeQuery($query, array( + ':content' => array($question->getContent(), PDO::PARAM_STR), + ':type' => array(get_class($question), PDO::PARAM_STR), + ':form' => array($question->getForm(), PDO::PARAM_STR), + ':id' => array($question->getId(), PDO::PARAM_STR) + )); + + $this->connection->executeQuery(); + } + } \ No newline at end of file