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.
34 lines
940 B
34 lines
940 B
<?php
|
|
|
|
require_once('model/skin.php');
|
|
|
|
class SkinGateway{
|
|
|
|
private $connection;
|
|
|
|
public function __construct($_connection){
|
|
$this->connection=$_connection;
|
|
}
|
|
|
|
/* Functions implemented to manage skins' data from database
|
|
* getGames : returning all the skins found in database
|
|
* getGameById : returning a skin found in database with its id
|
|
*/
|
|
|
|
/// Brief : Returning all the skins found in database
|
|
public function getSkins():?array{
|
|
$tabSkins=null;
|
|
$skinQuery="SELECT * FROM T_H_SKIN_SKI";
|
|
$this->connection->execQuery($skinQuery,[]);
|
|
$res = $this->connection->getRes();
|
|
foreach($res as $row){
|
|
$tabSkins[]= new Skin($row['PK_ID'],
|
|
$row['SKI_NAME'],
|
|
$row['SKI_IMAGE'],
|
|
$row['SKI_PRICE']);
|
|
}
|
|
return $tabSkins;
|
|
}
|
|
}
|
|
|
|
?>
|