PHP Class Services\UserManager

Exibir arquivo Open project: doptor/doptor

Public Methods

Method Description
activateUser ( $id ) : mixed | void Activate a user
addUserToGroup ( $group_id, $user ) Add an user to an user group
createUser ( array $input = [] ) Create a new user
deactivateUser ( $id ) : mixed | void Deactivate a user
deleteUser ( $id ) : mixed | void Delete a user or multiple users
findAllUsers ( ) : mixed Find all users
findUserById ( $id, string $group_field = 'id' ) : mixed Find a user by id
getUserGroups ( SentryUser $user, string $value = null, key $key = null ) : array Get all the user groups that a user lies in
isBanned ( $id ) : boolean Check whether an user is banned or not
updateUser ( $id, array $input = [] ) : mixed | void Update an existing user
uploadImage ( File $file, integer $id = null ) : string Upload profile photo of user

Method Details

activateUser() public method

Activate a user
public activateUser ( $id ) : mixed | void
$id User ID
return mixed | void

addUserToGroup() public method

Add an user to an user group
public addUserToGroup ( $group_id, $user )
$group_id
$user

createUser() public method

Create a new user
public createUser ( array $input = [] )
$input array

deactivateUser() public method

Deactivate a user
public deactivateUser ( $id ) : mixed | void
$id User ID
return mixed | void

deleteUser() public method

Delete a user or multiple users
public deleteUser ( $id ) : mixed | void
$id
return mixed | void

findAllUsers() public method

Find all users
public findAllUsers ( ) : mixed
return mixed

findUserById() public method

Find a user by id
public findUserById ( $id, string $group_field = 'id' ) : mixed
$id
$group_field string
return mixed

getUserGroups() public method

Get all the user groups that a user lies in
public getUserGroups ( SentryUser $user, string $value = null, key $key = null ) : array
$user SentryUser The user
$value string Value
$key key Key
return array

isBanned() public method

Check whether an user is banned or not
public isBanned ( $id ) : boolean
$id
return boolean

updateUser() public method

Update an existing user
public updateUser ( $id, array $input = [] ) : mixed | void
$id
$input array
return mixed | void

uploadImage() public method

Upload profile photo of user
public uploadImage ( File $file, integer $id = null ) : string
$file File Input file
$id integer User ID (if editing)
return string File Path