1 | <?php |
||
10 | class User extends ActiveRecordModel |
||
11 | { |
||
12 | /** |
||
13 | * @var string $tableName name of the database table. |
||
14 | */ |
||
15 | protected $tableName = "User"; |
||
16 | |||
17 | /** |
||
18 | * Columns in the table. |
||
19 | * |
||
20 | * @var integer $id primary key auto incremented. |
||
21 | */ |
||
22 | public $id; |
||
23 | public $acronym; |
||
24 | public $email; |
||
25 | public $password; |
||
26 | public $created; |
||
27 | public $updated; |
||
28 | public $deleted; |
||
29 | public $active; |
||
30 | |||
31 | /** |
||
32 | * Set the password. |
||
33 | * |
||
34 | * @param string $password the password to use. |
||
35 | * |
||
36 | * @return void |
||
37 | */ |
||
38 | 3 | public function setPassword($password) |
|
42 | |||
43 | /** |
||
44 | * Verify the acronym and the password, if successful the object contains |
||
45 | * all details from the database row. |
||
46 | * |
||
47 | * @param string $acronym acronym to check. |
||
48 | * @param string $password the password to use. |
||
49 | * |
||
50 | * @return boolean true if acronym and password matches, else false. |
||
51 | */ |
||
52 | 2 | public function verifyPassword($acronym, $password) |
|
57 | |||
58 | /** |
||
59 | * Fetch data from the database for a specific user |
||
60 | * |
||
61 | * @param string $acronym acronym for the user. |
||
62 | * |
||
63 | * @return array data for the user. |
||
64 | */ |
||
65 | 2 | public function getUserData($acronym) |
|
70 | } |
||
71 |