PHP Class Devise\Users\UsersRepository

Datei anzeigen Open project: devisephp/cms Class Usage Examples

Public Properties

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

Protected Properties

Property Type Description
$DvsUser DvsUser DvsUser model to fetch database records
$Framework Devise\Support\Framework Framework components being used from Laravel's framework

Public Methods

Method Description
__construct ( DvsUser $DvsUser, Framework $Framework ) Construct a new users repository
findByEmail ( string $email ) : DvsUser Find user by email field
findById ( integer $id ) : DvsUser Find user by id
findByName ( string $name ) : DvsUser Find user by name field
findByUsername ( string $username ) : DvsUser Find user by name field
retrieveCurrentUser ( ) : DvsUser | null Retrieve currently logged-in user object
retrieveCurrentUserId ( ) : integer | null Retrieve current user id
users ( ) : Eloquent\Collection Paginated list of users

Protected Methods

Method Description
findByFieldAndValue ( string $fieldname, string $value ) : DvsUser Finds an instance of DvsUser using the specified fieldname and value

Method Details

__construct() public method

Construct a new users repository
public __construct ( DvsUser $DvsUser, Framework $Framework )
$DvsUser DvsUser
$Framework Devise\Support\Framework

findByEmail() public method

Find user by email field
public findByEmail ( string $email ) : DvsUser
$email string
return DvsUser

findByFieldAndValue() protected method

Finds an instance of DvsUser using the specified fieldname and value
protected findByFieldAndValue ( string $fieldname, string $value ) : DvsUser
$fieldname string
$value string
return DvsUser

findById() public method

Find user by id
public findById ( integer $id ) : DvsUser
$id integer
return DvsUser

findByName() public method

Find user by name field
public findByName ( string $name ) : DvsUser
$name string
return DvsUser

findByUsername() public method

Find user by name field
public findByUsername ( string $username ) : DvsUser
$username string
return DvsUser

retrieveCurrentUser() public method

Retrieve currently logged-in user object
public retrieveCurrentUser ( ) : DvsUser | null
return DvsUser | null | null

retrieveCurrentUserId() public method

Retrieve current user id
public retrieveCurrentUserId ( ) : integer | null
return integer | null | null

users() public method

Paginated list of users
public users ( ) : Eloquent\Collection
return Eloquent\Collection

Property Details

$DvsUser protected_oe property

DvsUser model to fetch database records
protected DvsUser $DvsUser
return DvsUser

$Framework protected_oe property

Framework components being used from Laravel's framework
protected Framework,Devise\Support $Framework
return Devise\Support\Framework

$errors public_oe property

Errors are kept in an array and can be used later if validation fails and we want to know why
public array $errors
return array

$message public_oe property

This is a message that we can store why validation failed
public string $message
return string