summaryrefslogtreecommitdiff
path: root/src/model/entities/Location.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/model/entities/Location.php')
-rw-r--r--src/model/entities/Location.php15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/model/entities/Location.php b/src/model/entities/Location.php
index b3c2f8a..66c3385 100644
--- a/src/model/entities/Location.php
+++ b/src/model/entities/Location.php
@@ -41,12 +41,8 @@ class Location
41 41
42 public static EntityManager $entityManager; 42 public static EntityManager $entityManager;
43 43
44 public function __construct(Prestation $presta = null) 44 public function __construct(?Prestation $presta = null){
45 { 45 $this->setPresta($presta);
46 if($presta != null)
47 {
48 $this->setPresta($presta);
49 }
50 } 46 }
51 47
52 // getters 48 // getters
@@ -191,17 +187,16 @@ class Location
191 return str_replace($search, '', $data); 187 return str_replace($search, '', $data);
192 } 188 }
193 // à mettre plus tard dans une classe mère 189 // à mettre plus tard dans une classe mère
194 public function hydrate(string $answers) 190 public function hydrate(string $answers): void
195 { 191 {
196 $answers = $this->cleanSpecialChars($answers); // possibilité que $answers devienne une chaine vide 192 $answers = $this->cleanSpecialChars($answers); // possibilité que $answers devienne une chaine vide
197 if($answers == '') 193 if($answers == '')
198 { 194 {
199 echo "erreur de Location::hydrate(), la chaine \$answers est vide.\n"; 195 echo "erreur de Location::hydrate(), la chaine \$answers est vide.\n";
200 return false; 196 return;
201 } 197 }
202 $data_array = explode('|', $answers); // array 198 $data_array = explode('|', $answers); // array
203 199
204 $check = false;
205 if(count($data_array) === 8) 200 if(count($data_array) === 8)
206 { 201 {
207 $this->getPresta()->setModePaiement(''); // sécurité, doctrine plante si "null" 202 $this->getPresta()->setModePaiement(''); // sécurité, doctrine plante si "null"
@@ -210,7 +205,7 @@ class Location
210 else 205 else
211 { 206 {
212 echo "erreur de Location::hydrate(), le tableau \$data_array n'a pas la taille attendue.\n"; 207 echo "erreur de Location::hydrate(), le tableau \$data_array n'a pas la taille attendue.\n";
213 return false; 208 return;
214 } 209 }
215 210
216 //self::$entityManager->persist('Prestation'); 211 //self::$entityManager->persist('Prestation');