-
Notifications
You must be signed in to change notification settings - Fork 0
Usage of User Model
Häbu edited this page Mar 31, 2017
·
6 revisions
You can create the user by offering user-properties and you should set the Database instance afterwards. For the Crud Operations it is not important to make an instance of the class, cause all CRUD-operations are defined static.
$user = new User([ID] = NULL,[EMAIL] = NULL,[PASSWORD] = NULL);
$user->setDatabase([DATABASE INSTANCE]);
User::addUser([USERNAME],[PASSWORD]);
It's possible to select a whole user-entity (without password) by user-id or e-mail. Returns a user-object.
User::selectUserByName([EMAIL]);
User::selectUserById([ID]);
User::deleteUser([ID]);
Each parameter unless the id is optional. If u don't need the first but the second or the third for example, then place empty string-containers as placeholders in the method-call
User::updateUser([ID],[USERNAME],[PASSWORD]);
Returns a boolean
User::verifyUser([EMAIL],[PASSWORD_CLEAR]);