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/GatewayListResponseOfCandid...

52 lines
1.3 KiB

<?php
namespace API\script\Gateway;
use API\script\Config\Connection;
use PDO;
class GatewayListResponseOfCandidate
{
private Connection $connection;
public function __construct()
{
$this->connection = connect();
}
public function getDetailsListResponsesOfCandidate(int $idListResponse)
{
$gatewayResponse = new GatewayResponse();
$gatewayKeyword = new GatewayKeyword();
$tabKeywords = [];
$query = "SELECT * FROM ListResponsesOfCandidate WHERE id = :id";
$this->connection->executeQuery($query, array(
':id' => array($idListResponse, PDO::PARAM_INT)
));
$questionList = $this->connection->getResults()[0];
$responses = $gatewayResponse->getResponsesByIdListCandidate($questionList['id']);
foreach ($responses as $row) {
$tabKeywords[] = $gatewayKeyword->getKeywordsContentByCategorieze($row['id']);
}
return array($questionList, $responses, $tabKeywords);
}
public function getAllListResponsesOfCandidate(): array
{
$query = "SELECT * FROM ListResponsesOfCandidate";
$this->connection->executeQuery($query);
return $this->connection->getResults();
}
public function deleteListResponseOfCandidate(): void
{
}
}