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

Public Member Functions

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

Detailed Description

Handle creating and retrieving users from the database

Definition at line 12 of file UserRepository.php.

Member Function Documentation

◆ all()

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

Get all users registered in the database

Returns
User[]|Collection

Implemented in BristolSU\Support\User\UserRepository.

◆ create()

BristolSU\Support\User\Contracts\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

Implemented in BristolSU\Support\User\UserRepository.

◆ getById()

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

Get a user by ID

Parameters
int$idID of the user
Returns
User
Exceptions
ModelNotFoundException

Implemented in BristolSU\Support\User\UserRepository.

◆ getFromControlId()

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

Get a user matching the given control ID

Parameters
int$controlIdControl ID of the user
Returns
User

Implemented in BristolSU\Support\User\UserRepository.

◆ getFromRememberToken()

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

Get a user by remember token

Parameters
string$tokenRemember token
Returns
User
Exceptions
ModelNotFoundException

Implemented in BristolSU\Support\User\UserRepository.

◆ getWhereEmail()

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

Get a user matching the given email address.

Parameters
string$emailEmail address of the user
Returns
User

Implemented in BristolSU\Support\User\UserRepository.

◆ setRememberToken()

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

Set the remember token of a user

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

Implemented in BristolSU\Support\User\UserRepository.


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