소스 검색

Corrected invalid requests

Brendan Abolivier 9 년 전
부모
커밋
679894cfcd
3개의 변경된 파일13개의 추가작업 그리고 5개의 파일을 삭제
  1. 3
    1
      models/data.class.php
  2. 4
    2
      models/file.class.php
  3. 6
    2
      models/promo.class.php

+ 3
- 1
models/data.class.php 파일 보기

177
             "where" => array(
177
             "where" => array(
178
                 array("identifiant", "=", $this->identifiant)
178
                 array("identifiant", "=", $this->identifiant)
179
             )
179
             )
180
-        ))[0];
180
+        ));
181
 
181
 
182
         if(!$data)
182
         if(!$data)
183
         {
183
         {
184
             throw new UnexpectedValueException("Les données n'existent plus en base de données");
184
             throw new UnexpectedValueException("Les données n'existent plus en base de données");
185
         }
185
         }
186
 
186
 
187
+        $data = $data[0];
188
+
187
         $attrs = get_object_vars($this);
189
         $attrs = get_object_vars($this);
188
         $toUpdate = array();
190
         $toUpdate = array();
189
 
191
 

+ 4
- 2
models/file.class.php 파일 보기

17
             "where" => array(
17
             "where" => array(
18
                 array("id", "=", $id)
18
                 array("id", "=", $id)
19
             )
19
             )
20
-        ))[0];
20
+        ));
21
 
21
 
22
         if(!$document)
22
         if(!$document)
23
         {
23
         {
24
             throw new LengthException("Le fichier n'existe pas");
24
             throw new LengthException("Le fichier n'existe pas");
25
         }
25
         }
26
 
26
 
27
+        $document = $document[0];
28
+
27
         $this->id = $document["id"];
29
         $this->id = $document["id"];
28
         $this->rang = $document["rang"];
30
         $this->rang = $document["rang"];
29
         $this->promo = $document["promo"];
31
         $this->promo = $document["promo"];
66
             "where" => array(
68
             "where" => array(
67
                 array("promo_id", "=", $newPromo)
69
                 array("promo_id", "=", $newPromo)
68
             )
70
             )
69
-        ))[0];
71
+        ));
70
 
72
 
71
         if(!$promo)
73
         if(!$promo)
72
         {
74
         {

+ 6
- 2
models/promo.class.php 파일 보기

14
             "where" => array(
14
             "where" => array(
15
                 array("id_promo", "=", $id)
15
                 array("id_promo", "=", $id)
16
             )
16
             )
17
-        ))[0];
17
+        ));
18
 
18
 
19
         if($promo == NULL)
19
         if($promo == NULL)
20
         {
20
         {
21
             throw new LengthException("La promo n'existe pas");
21
             throw new LengthException("La promo n'existe pas");
22
         }
22
         }
23
 
23
 
24
+        $promo = $promo[0];
25
+
24
         $this->id_promo = $promo["id_promo"];
26
         $this->id_promo = $promo["id_promo"];
25
         $this->libelle = $promo["libelle"];
27
         $this->libelle = $promo["libelle"];
26
     }
28
     }
71
             "where" => array(
73
             "where" => array(
72
                 array("id_promo", "=", $this->id_promo)
74
                 array("id_promo", "=", $this->id_promo)
73
             )
75
             )
74
-        ))[0];
76
+        ));
75
 
77
 
76
         if(!$promo)
78
         if(!$promo)
77
         {
79
         {
78
             throw new UnexpectedValueException("La promo n'existe plus en base de données");
80
             throw new UnexpectedValueException("La promo n'existe plus en base de données");
79
         }
81
         }
80
 
82
 
83
+        $promo = $promo[0];
84
+
81
         $attrs = get_object_vars($this);
85
         $attrs = get_object_vars($this);
82
         $toUpdate = array();
86
         $toUpdate = array();
83
 
87