| Total Complexity | 2 |
| Total Lines | 44 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 10 | class User extends MyActiveRecord |
||
| 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 $username; |
||
| 24 | public $password; |
||
| 25 | public $email; |
||
| 26 | public $rank; |
||
| 27 | public $voted; |
||
| 28 | |||
| 29 | /** |
||
| 30 | * Set the password. |
||
| 31 | * |
||
| 32 | * @param string $password the password to use. |
||
| 33 | * |
||
| 34 | * @return void |
||
| 35 | */ |
||
| 36 | 2 | public function setPassword($password) |
|
| 39 | 2 | } |
|
| 40 | |||
| 41 | /** |
||
| 42 | * Verify the acronym and the password, if successful the object contains |
||
| 43 | * all details from the database row. |
||
| 44 | * |
||
| 45 | * @param string $acronym acronym to check. |
||
| 46 | * @param string $password the password to use. |
||
| 47 | * |
||
| 48 | * @return boolean true if acronym and password matches, else false. |
||
| 49 | */ |
||
| 50 | 3 | public function verifyPassword($username, $password) |
|
| 56 |