1 | <?php |
||
8 | class User |
||
9 | { |
||
10 | private $id; |
||
11 | private $name; |
||
12 | private $role; |
||
13 | private $email; |
||
14 | private $phone; |
||
15 | private $created; |
||
16 | private $updated; |
||
17 | |||
18 | private $authenticated; |
||
19 | |||
20 | private static $roles = [ |
||
21 | "employee" => true, |
||
22 | "manager" => true |
||
23 | ]; |
||
24 | |||
25 | public static function employeeNamedWithEmail($name, $email) |
||
29 | |||
30 | public static function managerNamedWithEmail($name, $email) |
||
34 | |||
35 | public function __construct($id, $name, $role, $email = null, $phone = null, |
||
61 | |||
62 | public function getId() |
||
66 | |||
67 | public function getName() |
||
71 | |||
72 | public function getRole() |
||
76 | |||
77 | public function getEmail() |
||
81 | |||
82 | public function getPhone() |
||
86 | |||
87 | public function getCreated() |
||
91 | |||
92 | public function getUpdated() |
||
96 | |||
97 | public function isAuthenticated() |
||
101 | |||
102 | public function authenticate() |
||
106 | } |
||
107 |