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

Public Member Functions

 __construct (Request $request, RoleRepository $roleRepository, GroupRepository $groupRepository, UserRepository $userRepository)
 
 getGroup ()
 
 getRole ()
 
 getUser ()
 
 setGroup (Group $group)
 
 setRole (Role $role)
 
 setUser (User $user)
 
 reset ()
 
- Public Member Functions inherited from BristolSU\Support\Authentication\Contracts\Authentication
 setUser (User $user)
 

Private Attributes

 $request
 
 $roleRepository
 
 $groupRepository
 
 $userRepository
 

Detailed Description

Api Authentication for getting authentication models from the query string

Definition at line 18 of file ApiAuthentication.php.

Constructor & Destructor Documentation

◆ __construct()

BristolSU\Support\Authentication\ApiAuthentication::__construct ( Request  $request,
RoleRepository  $roleRepository,
GroupRepository  $groupRepository,
UserRepository  $userRepository 
)

Initialise the API authentication

Parameters
Request$requestRequest object to get parameters from
RoleRepository$roleRepositoryRole repository for retrieving roles
GroupRepository$groupRepositoryGroup repository for retrieving groups
UserRepository$userRepositoryUser repository for retrieving users

Definition at line 57 of file ApiAuthentication.php.

References BristolSU\Support\Authentication\ApiAuthentication\$groupRepository, BristolSU\Support\Authentication\ApiAuthentication\$request, BristolSU\Support\Authentication\ApiAuthentication\$roleRepository, and BristolSU\Support\Authentication\ApiAuthentication\$userRepository.

Member Function Documentation

◆ getGroup()

BristolSU\Support\Authentication\ApiAuthentication::getGroup ( )

Get a group from the group_id parameter

Returns
Group|null

Implements BristolSU\Support\Authentication\Contracts\Authentication.

Definition at line 73 of file ApiAuthentication.php.

References BristolSU\Support\Authentication\ApiAuthentication\getRole().

◆ getRole()

BristolSU\Support\Authentication\ApiAuthentication::getRole ( )

Get a role from the role_id parameter

Returns
Role|null

Implements BristolSU\Support\Authentication\Contracts\Authentication.

Definition at line 93 of file ApiAuthentication.php.

Referenced by BristolSU\Support\Authentication\ApiAuthentication\getGroup().

◆ getUser()

BristolSU\Support\Authentication\ApiAuthentication::getUser ( )

Get a user from the user_id parameter

Returns
User|null

Implements BristolSU\Support\Authentication\Contracts\Authentication.

Definition at line 109 of file ApiAuthentication.php.

◆ reset()

BristolSU\Support\Authentication\ApiAuthentication::reset ( )

Reset the query strings to null

Returns
void

Implements BristolSU\Support\Authentication\Contracts\Authentication.

Definition at line 158 of file ApiAuthentication.php.

◆ setGroup()

BristolSU\Support\Authentication\ApiAuthentication::setGroup ( Group  $group)

Set the group

Parameters
Group$group
Returns
void

Implements BristolSU\Support\Authentication\Contracts\Authentication.

Definition at line 126 of file ApiAuthentication.php.

◆ setRole()

BristolSU\Support\Authentication\ApiAuthentication::setRole ( Role  $role)

Set the role

Parameters
Role$role
Returns
void

Implements BristolSU\Support\Authentication\Contracts\Authentication.

Definition at line 137 of file ApiAuthentication.php.

◆ setUser()

BristolSU\Support\Authentication\ApiAuthentication::setUser ( User  $user)

Set the user

Parameters
User$user
Returns
void

Definition at line 148 of file ApiAuthentication.php.

Member Data Documentation

◆ $groupRepository

BristolSU\Support\Authentication\ApiAuthentication::$groupRepository
private

◆ $request

BristolSU\Support\Authentication\ApiAuthentication::$request
private

◆ $roleRepository

BristolSU\Support\Authentication\ApiAuthentication::$roleRepository
private

◆ $userRepository

BristolSU\Support\Authentication\ApiAuthentication::$userRepository
private

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