PHP Класс Devise\Users\Sessions\SessionsRepository

Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$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)

Свойство Тип Описание
$DvsUser DvsUser DvsUser model to fetch database records
$Framework Devise\Support\Framework Framework components being used from Laravel's framework
$UserManager Devise\Users\UserManager UserManager manages users
$UsersRepository Devise\Users\UsersRepository UsersRepository fetches users and related data

Открытые методы

Метод Описание
__construct ( DvsUser $DvsUser, UserManager $UserManager, UsersRepository $UsersRepository, Framework $Framework ) Create a new SessionsRepository instance.
activate ( integer $userId, string $activateCode ) : False | DeviseUser Process user activation request.
getRememberMe ( $input ) : boolean Get "remember_me" field value
login ( array $input ) : User Attempty to login a user
logout ( ) : boolean Log user out
recoverPassword ( array $input ) : Response Handle a POST request to recover password
resetPassword ( array $input ) : Response Handle POST data from reset (change) password form
sendActivationEmail ( DvsUser $user ) : Void Send activation email.
validateCredentials ( $credentials ) : boolean Validate user credentials (without logging user into system)

Защищенные методы

Метод Описание
attemptUserLogin ( array $input ) : DvsUser | false Iterates through an array of username/email fields in the users table and attempts to authenticate an instance of DvsUser
retrieveUserFindMethodByField ( string $fieldname, string $value ) : DvsUser Gets the proper UsersRepository find method for a user based on the fieldname being passed in.

Приватные методы

Метод Описание
checkFieldExists ( $field )

Описание методов

__construct() публичный Метод

Create a new SessionsRepository instance.
public __construct ( DvsUser $DvsUser, UserManager $UserManager, UsersRepository $UsersRepository, Framework $Framework )
$DvsUser DvsUser
$UserManager Devise\Users\UserManager
$UsersRepository Devise\Users\UsersRepository
$Framework Devise\Support\Framework

activate() публичный Метод

Process user activation request.
public activate ( integer $userId, string $activateCode ) : False | DeviseUser
$userId integer
$activateCode string
Результат False | DeviseUser | DeviseUser

attemptUserLogin() защищенный Метод

Iterates through an array of username/email fields in the users table and attempts to authenticate an instance of DvsUser
protected attemptUserLogin ( array $input ) : DvsUser | false
$input array
Результат DvsUser | false | false

getRememberMe() публичный Метод

Get "remember_me" field value
public getRememberMe ( $input ) : boolean
Результат boolean

login() публичный Метод

Attempty to login a user
public login ( array $input ) : User
$input array
Результат User

logout() публичный Метод

Log user out
public logout ( ) : boolean
Результат boolean

recoverPassword() публичный Метод

Handle a POST request to recover password
public recoverPassword ( array $input ) : Response
$input array
Результат Response

resetPassword() публичный Метод

Handle POST data from reset (change) password form
public resetPassword ( array $input ) : Response
$input array
Результат Response

retrieveUserFindMethodByField() защищенный Метод

Gets the proper UsersRepository find method for a user based on the fieldname being passed in.
protected retrieveUserFindMethodByField ( string $fieldname, string $value ) : DvsUser
$fieldname string
$value string
Результат DvsUser

sendActivationEmail() публичный Метод

Send activation email.
public sendActivationEmail ( DvsUser $user ) : Void
$user DvsUser
Результат Void

validateCredentials() публичный Метод

Validate user credentials (without logging user into system)
public validateCredentials ( $credentials ) : boolean
Результат boolean

Описание свойств

$DvsUser защищенное свойство

DvsUser model to fetch database records
protected DvsUser $DvsUser
Результат DvsUser

$Framework защищенное свойство

Framework components being used from Laravel's framework
protected Framework,Devise\Support $Framework
Результат Devise\Support\Framework

$UserManager защищенное свойство

UserManager manages users
protected UserManager,Devise\Users $UserManager
Результат Devise\Users\UserManager

$UsersRepository защищенное свойство

UsersRepository fetches users and related data
protected UsersRepository,Devise\Users $UsersRepository
Результат Devise\Users\UsersRepository

$errors публичное свойство

Errors are kept in an array and can be used later if validation fails and we want to know why
public array $errors
Результат array

$message публичное свойство

This is a message that we can store why validation failed
public string $message
Результат string