1 | <?php |
||
13 | class User extends ActiveRecordModel |
||
14 | { |
||
15 | |||
16 | /** |
||
17 | * @var string $tableName name of the database table. |
||
18 | */ |
||
19 | protected $tableName = "Users"; |
||
20 | |||
21 | /** |
||
22 | * Columns in the table. |
||
23 | * |
||
24 | * @var integer $id primary key auto incremented. |
||
25 | */ |
||
26 | public $id; |
||
27 | public $name; |
||
28 | public $email; |
||
29 | public $age; |
||
30 | public $password; |
||
31 | public $created; |
||
32 | public $updated; |
||
33 | public $deleted; |
||
34 | public $active; |
||
35 | |||
36 | |||
37 | /** |
||
38 | * Set the password. |
||
39 | * |
||
40 | * @param string $password the password to use. |
||
41 | * |
||
42 | * @return void |
||
43 | */ |
||
44 | public function setPassword($password) |
||
48 | |||
49 | |||
50 | /** |
||
51 | * Verify the email and the password, if successful the object contains |
||
52 | * all details from the database row. |
||
53 | * |
||
54 | * @param $email |
||
55 | * @param string $password the password to use. |
||
56 | * @return bool true if email and password matches, else false. |
||
57 | * @internal param string $email email to check. |
||
58 | */ |
||
59 | public function verifyPassword($email, $password) |
||
64 | |||
65 | public function getInformation($email) |
||
70 | |||
71 | public function getInformationById($id) |
||
72 | { |
||
73 | $res = $this->find("id", $id); |
||
74 | return $res; |
||
75 | } |
||
76 | |||
77 | public function getInformationLimit($number) |
||
82 | |||
83 | public function returnPermissions($email) |
||
89 | |||
90 | public function checkUserExists($email) |
||
95 | } |
||
96 |