class UsersRepository

Class UsersRepository is used to search and retrieve DvsUser models and things in context of a Devise User.

Properties

array $errors Errors are kept in an array and can be used later if validation fails and we want to know why
string $message This is a message that we can store why validation failed

Methods

__construct(DvsUser $DvsUser, Framework $Framework)

Construct a new users repository

DvsUser
retrieveCurrentUser()

Retrieve currently logged-in user object

Integer
retrieveCurrentUserId()

Retrieve current user id

DvsUser
findById(int $id)

Find user by id

Collection
users()

Paginated list of users

DvsUser
findByEmail(string $email)

Find user by email field

DvsUser
findByName(string $name)

Find user by name field

DvsUser
findByUsername(string $username)

Find user by name field

Details

at line 48
__construct(DvsUser $DvsUser, Framework $Framework)

Construct a new users repository

Parameters

DvsUser $DvsUser
Framework $Framework

at line 59
DvsUser retrieveCurrentUser()

Retrieve currently logged-in user object

Return Value

DvsUser | null

at line 69
Integer retrieveCurrentUserId()

Retrieve current user id

Return Value

Integer | null

at line 80
DvsUser findById(int $id)

Find user by id

Parameters

int $id

Return Value

DvsUser

at line 90
Collection users()

Paginated list of users

Return Value

Collection

at line 101
DvsUser findByEmail(string $email)

Find user by email field

Parameters

string $email

Return Value

DvsUser

at line 112
DvsUser findByName(string $name)

Find user by name field

Parameters

string $name

Return Value

DvsUser

at line 123
DvsUser findByUsername(string $username)

Find user by name field

Parameters

string $username

Return Value

DvsUser