1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<?php
class Game extends Model {
// ===========
// = Statics =
// ===========
protected static $table_name = 'GAME';
public static function getList()
{
$stm = parent::exec('GAME_LIST');
return $stm->fetchAll();
}
public static function getGame($id)
{
$stm = parent::exec('GAME_BY_ID', array(':game_id' => $id));
return $stm->fetchAll();
}
public static function createGame($values)
{
$stm = parent::exec('GAME_CREATE',$values);
$stmbis = parent::exec('GAME_ID_MAX');
return $stmbis->fetchAll();
}
public static function updateGame($values)
{
$stm = parent::exec('GAME_UPDATE',$values);
return "La game a été uploader";
}
public static function deleteGame($id)
{
$stm = parent::exec('GAME_DELETE',array(":GAME_ID" => $id));
return "Game deleted";
}
public static function getUsers($id)
{
$stm = parent::exec('GAME_GET_USERS', array(":GAME_ID" => $id));
return $stm->fetchAll();
}
public static function addUserGame($values)
{
$stm = parent::exec('GAME_ADD_USER', $values);
return $stm;
}
public static function deleteUserGame($values)
{
$stm = parent::exec('GAME_DELETE_USER', $values);
return $stm;
}
}