$id
$id : integer
Class User.
Modifies user informations in the database
getUser(\Vigas\Application\Model\PDO $db, array $conditions, string $password = null) : boolean
Gets user from the database and set User object properties
| \Vigas\Application\Model\PDO | $db | database connection object |
| array | $conditions | The SQL condition(s) to select the user |
| string | $password | The user password |
Returns false if user has not been found
insertUser(\Vigas\Application\Model\PDO $db, string $username, string $email, string $password) : boolean
Inserts a new user account into the database
| \Vigas\Application\Model\PDO | $db | Database connection object |
| string | $username | The user username |
| string | The user email address |
|
| string | $password | The user password |
Returns true if account has been created, false otherwise
updatePassword(\Vigas\Application\Model\PDO $db, array $conditions, string $new_password) : boolean
Changes a user password
| \Vigas\Application\Model\PDO | $db | Database connection object |
| array | $conditions | The SQL condition(s) to select the user |
| string | $new_password | The new user password |
Returns true if the password has been changed, false otherwise
deleteResetPwdToken(\Vigas\Application\Model\PDO $db, integer $id) : boolean
Deletes the reset password token after the user set up a new password
| \Vigas\Application\Model\PDO | $db | Database connection object |
| integer | $id | The user id |
Returns true if reset_pwd_token and reset_pwd_token_endat columns has been set to NULL, false otherwise
checkUniqueUsername(\Vigas\Application\Model\PDO $db, string $username) : boolean
Checks if an account already exist with the given username
| \Vigas\Application\Model\PDO | $db | Database connection object |
| string | $username | The username address to check |
Returns true if the username is unique (not found in database), false otherwise
checkUniqueEmail(\Vigas\Application\Model\PDO $db, string $email) : boolean
Checks if an account already exist with the given email address
| \Vigas\Application\Model\PDO | $db | Database connection object |
| string | The email address to check |
Returns true if the email address is unique (not found in database), false otherwise
firstLinkDone(\Vigas\Application\Model\PDO $db, integer $id) : boolean
Sets first_link_done column to true
| \Vigas\Application\Model\PDO | $db | Database connection object |
| integer | $id | The user id |
Returns true if first_link_done has been set to true, false otherwise
saveResetPwdToken(\Vigas\Application\Model\PDO $db, string $token, integer $id) : boolean
Saves reset password token and reset password token expiration datetime into database
| \Vigas\Application\Model\PDO | $db | Database connection object |
| string | $token | The reset password token |
| integer | $id | The user id |
returns true if reset password token and reset password token expiration datetime has been saved, false otherwise