Devise
Class

Devise\Users\UsersRepository

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 address

Details

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

Construct a new users repository

Parameters

DvsUser $DvsUser
Framework $Framework

at line 59
public DvsUser retrieveCurrentUser()

Retrieve currently logged-in user object

Return Value

DvsUser | null

at line 69
public Integer retrieveCurrentUserId()

Retrieve current user id

Return Value

Integer | null

at line 80
public DvsUser findById(int $id)

Find user by id

Parameters

int $id

Return Value

DvsUser

at line 90
public Collection users()

Paginated list of users

Return Value

Collection

at line 101
public DvsUser findByEmail(string $email)

Find user by email address

Parameters

string $email

Return Value

DvsUser