|
|
|
@ -4,7 +4,6 @@ namespace API\script\Gateway;
|
|
|
|
|
|
|
|
|
|
use API\script\Config\Connection;
|
|
|
|
|
use BusinessClass\Form;
|
|
|
|
|
use BusinessClass\Keyword;
|
|
|
|
|
use BusinessClass\Question;
|
|
|
|
|
use PDO;
|
|
|
|
|
|
|
|
|
@ -19,8 +18,7 @@ class GatewayForm
|
|
|
|
|
|
|
|
|
|
public function insertForm(Form $form): void
|
|
|
|
|
{
|
|
|
|
|
if(empty($this->getForm()))
|
|
|
|
|
{
|
|
|
|
|
if(empty($this->getForm())) {
|
|
|
|
|
$query = "INSERT INTO Form(title, description) VALUES(:title, :description)";
|
|
|
|
|
$this->connection->executeQuery($query, array(
|
|
|
|
|
':title' => array($form->getTitle(), PDO::PARAM_STR),
|
|
|
|
@ -47,7 +45,6 @@ class GatewayForm
|
|
|
|
|
|
|
|
|
|
public function assignKeywordToQuestion(string $keyword, string $response, int $idQuestion): void
|
|
|
|
|
{
|
|
|
|
|
echo $keyword;
|
|
|
|
|
$query = "SELECT pr.id FROM Propose p, PossibleResponse pr WHERE p.question = :id AND p.possibleResponse = pr.id AND pr.content = :response";
|
|
|
|
|
$this->connection->executeQuery($query, array(
|
|
|
|
|
':id' => array($idQuestion, PDO::PARAM_INT),
|
|
|
|
|