classes métiers Enigme et Partie, la Factory d' Enigme est souvent utilisée pour créer des parties et la factory de partie sera utile pour faire l' historique des parties plus tardServeurDeTest
parent
48b0ad212d
commit
00257a2ba4
@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
class EnigmeFactory{
|
||||||
|
public static function create($results)
|
||||||
|
{
|
||||||
|
$tabEnigme=array();
|
||||||
|
foreach($results as $row)
|
||||||
|
{
|
||||||
|
$tabEnigme[]= new Enigme($row['id'],$row['admin'],$row['enonce'],$row['aide'],$row['rappel'],$row['solution'],$row['test'],$row['tempsDeResolution'],$row['points']);
|
||||||
|
}
|
||||||
|
return $tabEnigme;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
class PartieFactory{
|
||||||
|
public static function create($results)
|
||||||
|
{
|
||||||
|
$tabPartie=array();
|
||||||
|
foreach($results as $row)
|
||||||
|
{
|
||||||
|
$tabPartie= new Partie($row['id']);
|
||||||
|
}
|
||||||
|
return $tabPartie;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in new issue