1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- <?php
-
-
- class Question {
- private $reponse1;
- private $reponse2;
- private $intitule;
- private $bonneReponse;
-
-
-
- function __construct($intitule) {
- try{
- $this->intitule = $intitule;
-
- $bdd = new Connector();
-
- $options = array(
- "where" => array(
- array("intitule", "=", $intitule)
- )
- );
- $question = $bdd->Select('*', 'questions', $options);
-
- $this->reponse1 = $question[0]['reponse1'];
- $this->reponse2 = $question[0]['reponse2'];
-
- $this->bonneReponse = $question[0]['num_reponse'];
- } catch(Exception $e) {
- throw $e;
- }
- }
-
-
-
- function getArray() {
- return array(
- "intitule" => utf8_encode($this->intitule),
- "bonneReponse" => utf8_encode($this->bonneReponse)
- );
- }
- }
|