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
60
61
62
63
64
65
66
67
68
69
<?php
class User extends Model
{
// ===========
// = Statics =
// ===========
protected static $table_name = 'MJ_USER';
// load all users from Db
public static function getList()
{
$stm = parent::exec('USER_LIST');
return $stm->fetchAll();
}
public static function getRow($id)
{
$stm = parent::exec('USER_GET_WITH_ID', ['id' => $id]);
return $stm->fetchAll();
}
public static function updateUser($array)
{
$stm = parent::exec('USER_UPDATE', $array);
}
public static function tryLogin($login)
{
$stm = parent::exec('USER_GET_WITH_LOGIN', ['login' => $login]);
return $stm->fetch();
}
public function id()
{
return trim($this->ID_USER);
}
public function role()
{
return trim($this->ID_ROLE);
}
public function password()
{
return trim($this->PASWORD);
}
public function avatar()
{
return trim($this->AVATAR);
}
public function lastname()
{
return trim($this->LASTNAME);
}
public function firstname()
{
return trim($this->FIRSTNAME);
}
public function email()
{
return trim($this->MAIL);
}
public function isBanned()
{
return trim($this->BAN_ACCOUNT);
}
public function lastIP()
{
return trim($this->LAST_IP);
}
}