1 | <?php |
||
9 | class User extends ActiveRecordModel |
||
10 | { |
||
11 | /** |
||
12 | * @var string $tableName name of the database table. |
||
13 | */ |
||
14 | protected $tableName = "User"; |
||
15 | |||
16 | /** |
||
17 | * Columns in the table. |
||
18 | * |
||
19 | * @var integer $id primary key auto incremented. |
||
20 | */ |
||
21 | public $id; |
||
22 | public $mail; |
||
23 | public $password; |
||
24 | public $created; |
||
25 | public $updated; |
||
26 | public $deleted; |
||
27 | public $active; |
||
28 | |||
29 | |||
30 | /** |
||
31 | * Creating $session var for inject |
||
32 | */ |
||
33 | private $session; |
||
34 | |||
35 | /** |
||
36 | * Init the class with session and database |
||
37 | */ |
||
38 | 10 | public function init($db, $session) |
|
43 | |||
44 | /** |
||
45 | * Set the password. |
||
46 | * |
||
47 | * @param string $password the password to use. |
||
48 | * |
||
49 | * @return void |
||
50 | */ |
||
51 | 2 | public function setPassword($password) |
|
55 | |||
56 | |||
57 | /** |
||
58 | * Verify the acronym and the password, if successful the object contains |
||
59 | * all details from the database row. |
||
60 | * |
||
61 | * @param string $acronym acronym to check. |
||
|
|||
62 | * @param string $password the password to use. |
||
63 | * |
||
64 | * @return boolean true if acronym and password matches, else false. |
||
65 | */ |
||
66 | 1 | public function verifyPassword($mail, $password) |
|
71 | |||
72 | /* |
||
73 | * Get all users. |
||
74 | */ |
||
75 | 1 | public function getAllUsers() |
|
79 | |||
80 | |||
81 | /* |
||
82 | * Get all users. |
||
83 | */ |
||
84 | 2 | public function deleteUser($id) |
|
85 | { |
||
86 | 2 | $this->find("id", $id); |
|
87 | 2 | $this->delete(); |
|
88 | 2 | } |
|
89 | |||
90 | |||
91 | /* |
||
92 | * Get a user based on ID |
||
93 | */ |
||
94 | 1 | public function getUser($id) |
|
95 | { |
||
96 | 1 | return $this->find("id", $id); |
|
97 | } |
||
98 | |||
99 | /* |
||
100 | * Get a user based on ID |
||
101 | */ |
||
102 | 2 | public function isLoggedIn() |
|
106 | |||
107 | |||
108 | /* |
||
109 | * Get a user based on ID |
||
110 | */ |
||
111 | 2 | public function getLoggedInUserId() |
|
115 | |||
116 | |||
117 | /* |
||
118 | * Get logged in user |
||
119 | * @return user class |
||
120 | */ |
||
121 | 1 | public function getLoggedInUser() |
|
127 | |||
128 | |||
129 | 1 | public function getUserImg($mail, $classes = "", $size = 125) |
|
136 | |||
137 | |||
138 | /* |
||
139 | * Return true is user is admin |
||
140 | */ |
||
141 | 1 | public function isUserAdmin() |
|
154 | } |
||
155 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.