PHP Class Backend\Modules\Users\Engine\Model

Show file Open project: forkcms/forkcms Class Usage Examples

Public Methods

Method Description
delete ( integer $id ) Mark the user as deleted and deactivate his account.
deleteResetPasswordSettings ( integer $id ) Deletes the reset_password_key and reset_password_timestamp for a given user ID
emailDeletedBefore ( string $email ) : boolean Was a user deleted before?
exists ( integer $id, boolean $active = true ) : boolean Does the user exist.
existsEmail ( string $email, integer $id = null ) : boolean Does a email already exist? If you specify a userId, the email with the given id will be ignored.
get ( integer $id ) : array Get all data for a given user
getCSVLineEndings ( ) : array Get the possible line endings for a CSV-file
getCSVSplitCharacters ( ) : array Get the possible CSV split characters
getDateFormats ( ) : array Fetch the list of date formats including examples of these formats.
getGroups ( ) : array Get user groups
getIdByEmail ( string $email ) : integer Get the user ID linked to a given email
getModuleGroupsRightsActions ( integer $userId ) : array Get all module action combinations a user has access to
getNumberFormats ( ) : array Fetch the list of number formats including examples of these formats.
getSetting ( integer $userId, string $setting ) : mixed Fetch a user setting for a specific user
getTimeFormats ( ) : array Fetch the list of time formats including examples of these formats.
getUsers ( ) : array Get all users
insert ( array $user, array $settings ) : integer Add a new user.
setSetting ( integer $userId, string $setting, string $value ) : mixed Set a user setting for a specific user
undoDelete ( string $email ) : boolean Restores a user
update ( array $user, array $settings ) Save the changes for a given user Remark: $user['id'] should be available
updatePassword ( User $user, string $password ) Update the user password

Method Details

delete() public static method

Mark the user as deleted and deactivate his account.
public static delete ( integer $id )
$id integer The userId to delete.

deleteResetPasswordSettings() public static method

Deletes the reset_password_key and reset_password_timestamp for a given user ID
public static deleteResetPasswordSettings ( integer $id )
$id integer The userId wherefore the reset-stuff should be deleted.

emailDeletedBefore() public static method

Was a user deleted before?
public static emailDeletedBefore ( string $email ) : boolean
$email string The e-mail address to check.
return boolean

exists() public static method

Does the user exist.
public static exists ( integer $id, boolean $active = true ) : boolean
$id integer The userId to check for existence.
$active boolean Should the user be active also?
return boolean

existsEmail() public static method

Does a email already exist? If you specify a userId, the email with the given id will be ignored.
public static existsEmail ( string $email, integer $id = null ) : boolean
$email string The email to check for.
$id integer The userId to be ignored.
return boolean

get() public static method

Get all data for a given user
public static get ( integer $id ) : array
$id integer The userId to get the data for.
return array

getCSVLineEndings() public static method

Get the possible line endings for a CSV-file
public static getCSVLineEndings ( ) : array
return array

getCSVSplitCharacters() public static method

Get the possible CSV split characters
public static getCSVSplitCharacters ( ) : array
return array

getDateFormats() public static method

Fetch the list of date formats including examples of these formats.
public static getDateFormats ( ) : array
return array

getGroups() public static method

Get user groups
public static getGroups ( ) : array
return array

getIdByEmail() public static method

Get the user ID linked to a given email
public static getIdByEmail ( string $email ) : integer
$email string The email for the user.
return integer

getModuleGroupsRightsActions() public static method

Get all module action combinations a user has access to
public static getModuleGroupsRightsActions ( integer $userId ) : array
$userId integer The id of the user
return array

getNumberFormats() public static method

Fetch the list of number formats including examples of these formats.
public static getNumberFormats ( ) : array
return array

getSetting() public static method

Fetch a user setting for a specific user
public static getSetting ( integer $userId, string $setting ) : mixed
$userId integer The id of the user.
$setting string The name of the setting to get.
return mixed

getTimeFormats() public static method

Fetch the list of time formats including examples of these formats.
public static getTimeFormats ( ) : array
return array

getUsers() public static method

Get all users
public static getUsers ( ) : array
return array

insert() public static method

Add a new user.
public static insert ( array $user, array $settings ) : integer
$user array The userdata.
$settings array The settings for the new user.
return integer

setSetting() public static method

Set a user setting for a specific user
public static setSetting ( integer $userId, string $setting, string $value ) : mixed
$userId integer The id of the user.
$setting string The name of the setting to set.
$value string The value of the setting to set.
return mixed

undoDelete() public static method

Restores a user
public static undoDelete ( string $email ) : boolean
$email string The e-mail address of the user to restore.
return boolean

update() public static method

Save the changes for a given user Remark: $user['id'] should be available
public static update ( array $user, array $settings )
$user array The userdata.
$settings array The settings for the user.

updatePassword() public static method

Update the user password
public static updatePassword ( User $user, string $password )
$user Backend\Core\Engine\User An instance of BackendUser.
$password string The new password for the user.