MetaFox

UserRepositoryInterface extends HasFeature
in

Interface User.

Tags
mixin

AbstractRepository

mixin

CollectTotalItemStatTrait

Table of Contents

Methods

approve()  : Content
assignRole()  : User
Add role/roles to an user.
banUser()  : bool
Ban an user.
cancelAccount()  : bool
cleanUpDeletedUser()  : void
cleanUpExpiredBanData()  : bool
Clean all expired ban data.
createAvatar()  : void
createAvatarFromSignup()  : void
createUser()  : User|null
deleteUser()  : bool
denyUser()  : Content
feature()  : bool
findAndValidateForAuth()  : User|null
Find an user for authentication.
findUserByEmail()  : User|null
Find an user by email.
findUserByEmailOrPhoneNumber()  : User|null
Find an user by email or phone.
getAdminAndStaffOptions()  : array<int, mixed>
getBan()  : UserBan|null
Get ban data of an user.
getInvisibleSettings()  : array<string, mixed>
getItemExtraStatistics()  : array<string, mixed>
getOnlineUserCount()  : int
getOnlineUserCount.
getPendingUserCount()  : int
getPendingUserCount.
getSuperAdmin()  : User|null
getUserByRoleId()  : User
getUsersByRoleId()  : Collection|null
getVerifyBy()  : string|null
getVerifyMessage()  : string|null
isBanned()  : bool
Check is banned.
isFeature()  : bool
removeBanUser()  : bool
Remove user from ban.
removeCover()  : bool
removeRole()  : User
Remove an user role.
searchBlockUser()  : mixed
update()  : User
updateAvatar()  : array<string, mixed>
updateCover()  : array<string, mixed>
updateThemePreference()  : void
Update user profile config which being stored in User value table.
updateUser()  : User
updateVideosSettings()  : User
uploadAvatar()  : array<string, mixed>
validateStatuses()  : void
validate if user account is accessible return an array that contains the validation error, null if passed.
validateVerifiedBy()  : void
viewUser()  : User
View a user.
viewUsers()  : Paginator
Browse users.

Methods

assignRole()

Add role/roles to an user.

public assignRole(int $userId, array<string|int, mixed>|array<string|int, Role>|string $roles) : User
Parameters
$userId : int
$roles : array<string|int, mixed>|array<string|int, Role>|string
Tags
throws
RoleDoesNotExist
Return values
User

banUser()

Ban an user.

public banUser(User $user, User $owner[, int $day = 0 ][, int $returnUserGroup = UserRole::NORMAL_USER_ID ][, string|null $reason = null ]) : bool
Parameters
$user : User
$owner : User
$day : int = 0
$returnUserGroup : int = UserRole::NORMAL_USER_ID
$reason : string|null = null
Tags
throws
AuthorizationException
throws
RoleDoesNotExist
Return values
bool

cancelAccount()

public cancelAccount(User $context, int $id, array<string, mixed> $params) : bool
Parameters
$context : User
$id : int
$params : array<string, mixed>
Return values
bool

cleanUpDeletedUser()

public cleanUpDeletedUser([int $period = 1 ]) : void
Parameters
$period : int = 1

Users are deleted after this period of days shall be applicable

cleanUpExpiredBanData()

Clean all expired ban data.

public cleanUpExpiredBanData() : bool
Return values
bool

createAvatar()

public createAvatar(User $context, UploadedFile $image, array<string, mixed> $params) : void
Parameters
$context : User
$image : UploadedFile
$params : array<string, mixed>

createAvatarFromSignup()

public createAvatarFromSignup(User $context, UploadedFile $image, array<string, mixed> $params) : void
Parameters
$context : User
$image : UploadedFile
$params : array<string, mixed>

createUser()

public createUser(array<string, mixed> $attributes) : User|null
Parameters
$attributes : array<string, mixed>
Return values
User|null

deleteUser()

public deleteUser(User $context, int $id) : bool
Parameters
$context : User
$id : int
Tags
throws
AuthorizationException
Return values
bool

feature()

public feature(User $context, int $id, int $feature) : bool
Parameters
$context : User
$id : int
$feature : int
Return values
bool

findAndValidateForAuth()

Find an user for authentication.

public findAndValidateForAuth(string $username, string $password) : User|null
Parameters
$username : string
$password : string
Return values
User|null

findUserByEmail()

Find an user by email.

public findUserByEmail(string $email) : User|null
Parameters
$email : string
Return values
User|null

findUserByEmailOrPhoneNumber()

Find an user by email or phone.

public findUserByEmailOrPhoneNumber(string $value) : User|null
Parameters
$value : string
Return values
User|null

getAdminAndStaffOptions()

public getAdminAndStaffOptions() : array<int, mixed>
Return values
array<int, mixed>

getInvisibleSettings()

public getInvisibleSettings(User $context) : array<string, mixed>
Parameters
$context : User
Return values
array<string, mixed>

getItemExtraStatistics()

public getItemExtraStatistics(User $context, User $user, string $itemType, int $itemId) : array<string, mixed>
Parameters
$context : User
$user : User
$itemType : string
$itemId : int
Return values
array<string, mixed>

getUsersByRoleId()

public getUsersByRoleId(int $roleId) : Collection|null
Parameters
$roleId : int
Return values
Collection|null

getVerifyBy()

public getVerifyBy(User $user, string $value) : string|null
Parameters
$user : User
$value : string
Return values
string|null

getVerifyMessage()

public getVerifyMessage(string|null $email, string|null $phoneNumber, array<string|int, mixed> $params) : string|null
Parameters
$email : string|null
$phoneNumber : string|null
$params : array<string|int, mixed>
Return values
string|null

isBanned()

Check is banned.

public isBanned(int $userId) : bool
Parameters
$userId : int
Return values
bool

removeBanUser()

Remove user from ban.

public removeBanUser(User $user, User $owner) : bool
Parameters
$user : User
$owner : User
Tags
throws
AuthorizationException
Return values
bool

removeCover()

public removeCover(User $context, int $id) : bool
Parameters
$context : User
$id : int
Tags
throws
AuthorizationException
Return values
bool

removeRole()

Remove an user role.

public removeRole(int $userId, Role|string $role) : User
Parameters
$userId : int
$role : Role|string
Tags
throws
RoleDoesNotExist
Return values
User

update()

public update(array<string|int, mixed> $attributes, mixed $id) : User
Parameters
$attributes : array<string|int, mixed>
$id : mixed
Return values
User

updateAvatar()

public updateAvatar(User $context, User $owner, array<string, mixed> $attribute) : array<string, mixed>
Parameters
$context : User
$owner : User
$attribute : array<string, mixed>
Tags
throws
ValidationException
throws
AuthorizationException
Return values
array<string, mixed>

updateCover()

public updateCover(User $context, User $owner, array<string, mixed> $attributes) : array<string, mixed>
Parameters
$context : User
$owner : User
$attributes : array<string, mixed>
Tags
throws
AuthorizationException
Return values
array<string, mixed>

updateThemePreference()

Update user profile config which being stored in User value table.

public updateThemePreference(User $user[, array<string, mixed> $attributes = [] ]) : void
Parameters
$user : User
$attributes : array<string, mixed> = []

updateUser()

public updateUser(User $context, int $id, array<string, mixed> $attributes) : User
Parameters
$context : User
$id : int
$attributes : array<string, mixed>
Return values
User

uploadAvatar()

public uploadAvatar(User $context, User $owner, array<string, mixed> $attributes) : array<string, mixed>
Parameters
$context : User
$owner : User
$attributes : array<string, mixed>
Tags
throws
ValidationException
throws
AuthorizationException
Return values
array<string, mixed>

viewUsers()

Browse users.

public viewUsers(User $context, array<string, mixed> $attributes) : Paginator
Parameters
$context : User
$attributes : array<string, mixed>
Tags
throws
AuthorizationException
Return values
Paginator

        
On this page

Search results