Bristol SU Support Package
Public Member Functions | List of all members
BristolSU\Support\User\UserRepository Class Reference
Inheritance diagram for BristolSU\Support\User\UserRepository:
Inheritance graph
[legend]
Collaboration diagram for BristolSU\Support\User\UserRepository:
Collaboration graph
[legend]

Public Member Functions

 all ()
 
 getFromControlId (int $controlId)
 
 create (array $attributes)
 
 getWhereEmail ($email)
 
 getFromRememberToken (string $token)
 
 getById (int $id)
 
 setRememberToken (int $id, $token)
 

Detailed Description

Handles retrieving and setting users.

Definition at line 13 of file UserRepository.php.

Member Function Documentation

◆ all()

BristolSU\Support\User\UserRepository::all ( )

Get all users registered in the database

Returns
User[]|Collection

Implements BristolSU\Support\User\Contracts\UserRepository.

Definition at line 21 of file UserRepository.php.

◆ create()

BristolSU\Support\User\UserRepository::create ( array  $attributes)

Create a user.

Attributes should be those in the database [ 'control_id' => 1, // ID of the control user model representing the user ];

Parameters
array$attributesAttributes to create the user with
Returns
User

Implements BristolSU\Support\User\Contracts\UserRepository.

Definition at line 49 of file UserRepository.php.

◆ getById()

BristolSU\Support\User\UserRepository::getById ( int  $id)

◆ getFromControlId()

BristolSU\Support\User\UserRepository::getFromControlId ( int  $controlId)

Get a user matching the given control ID

Parameters
int$controlIdControl ID of the user
Returns
User
Exceptions
ModelNotFoundException

Implements BristolSU\Support\User\Contracts\UserRepository.

Definition at line 33 of file UserRepository.php.

Referenced by BristolSU\Support\User\UserRepository\getWhereEmail().

◆ getFromRememberToken()

BristolSU\Support\User\UserRepository::getFromRememberToken ( string  $token)

Get a user by remember token

Parameters
string$tokenRemember token
Returns
User
Exceptions
ModelNotFoundException

Implements BristolSU\Support\User\Contracts\UserRepository.

Definition at line 75 of file UserRepository.php.

◆ getWhereEmail()

BristolSU\Support\User\UserRepository::getWhereEmail (   $email)

Get a user matching the given email address

Parameters
string$emailEmail address of the user
Returns
User
Exceptions
ModelNotFoundException

Implements BristolSU\Support\User\Contracts\UserRepository.

Definition at line 61 of file UserRepository.php.

References BristolSU\Support\User\UserRepository\getFromControlId().

◆ setRememberToken()

BristolSU\Support\User\UserRepository::setRememberToken ( int  $id,
  $token 
)

Set the remember token of a user

Parameters
int$idID of the user
mixed$tokenNew token for the user

Implements BristolSU\Support\User\Contracts\UserRepository.

Definition at line 94 of file UserRepository.php.

References BristolSU\Support\User\UserRepository\getById().


The documentation for this class was generated from the following file: