The User
class can be used to create, view or edit user instances. It is a Proxy class that provides a unified interface to access information on the other user sub-classes.
The sub-classes are:
User_Entity
User_Social
User_Registration
User_Info
$u = new User(); $u->username = "boostack"; $u->name = "Boostack System"; $u->email = "system@getboostack.com"; $u->pwd = "testing"; $u->privilege = "0"; $u->first_name = "Boostack"; $u->company = "Boostack"; $u->last_name = "System"; $u->save();// new user registration $u = new User([id of an existing user]); $u->name = "New Name "; $u->save();// update user data
Use the Auth class to manage login and logout for the current user.
fill($array)
load($id)
save($forcedID)
Transaction
. If there is a parameter ID the method invoke the save method of all under instance, otherwise save with incremental id from database and save under instance with the same id.delete()
jsonSerialize()
User::existById($id, $throwException)
User::existsByEmail($email, $throwException)
User::existsByUsername($username, $throwException)
User::getUserIDByEmail($email, $throwException)
User::getCredentialByCookie($cookieValue)
User::getActiveCredentialByEmail($email)
User::getActiveCredentialByUsername($username)
User::getActiveCredentialByEmailOrUsername($email, $username)
User::getActiveIdByEmailAndPassword($email, $password)
User::getActiveIdByUsernameAndPassword($username, $password)
User::getActiveIdByEmailOrUsernameAndPassword($email, $username, $password)
refreshRememberMeCookie()
You can use UserList
class to handle multiple user instances.
loadAll()
view($fields, $orderColumn, $orderType, $numitem, $currentPage)
fill($array, $excludePwd)
User
class.getSQLFromJoinPart()