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

Public Member Functions

 __construct (Session $session, GroupRepository $groupRepository, UserRepository $userRepository, RoleRepository $roleRepository)
 
 getGroup ()
 
 getRole ()
 
 getUser ()
 
 setGroup (Group $group)
 
 setRole (Role $role)
 
 setUser (User $user)
 
 reset ()
 

Private Attributes

 $session
 
 $groupRepository
 
 $userRepository
 
 $roleRepository
 

Detailed Description

Authentication for getting a user, group or role from the session

Definition at line 18 of file SessionAuthentication.php.

Constructor & Destructor Documentation

◆ __construct()

BristolSU\Support\Testing\Authentication\SessionAuthentication::__construct ( Session  $session,
GroupRepository  $groupRepository,
UserRepository  $userRepository,
RoleRepository  $roleRepository 
)

Initialise the session

Parameters
Session$sessionSession
GroupRepository$groupRepositoryGroup Repository
UserRepository$userRepositoryUser Repository
UserAuthentication$userAuthenticationDatabase User Authentication

Definition at line 58 of file SessionAuthentication.php.

References BristolSU\Support\Testing\Authentication\SessionAuthentication\$groupRepository, BristolSU\Support\Testing\Authentication\SessionAuthentication\$roleRepository, BristolSU\Support\Testing\Authentication\SessionAuthentication\$session, and BristolSU\Support\Testing\Authentication\SessionAuthentication\$userRepository.

Member Function Documentation

◆ getGroup()

BristolSU\Support\Testing\Authentication\SessionAuthentication::getGroup ( )

Get the group

Returns the group belonging to a role if logged into a role, otherwise the group logged in

Returns
Group|null

Implements BristolSU\Support\Authentication\Contracts\Authentication.

Definition at line 73 of file SessionAuthentication.php.

References BristolSU\Support\Testing\Authentication\SessionAuthentication\getRole().

◆ getRole()

BristolSU\Support\Testing\Authentication\SessionAuthentication::getRole ( )

◆ getUser()

BristolSU\Support\Testing\Authentication\SessionAuthentication::getUser ( )

Get the user

Returns
User|null

Implements BristolSU\Support\Authentication\Contracts\Authentication.

Definition at line 109 of file SessionAuthentication.php.

◆ reset()

BristolSU\Support\Testing\Authentication\SessionAuthentication::reset ( )

Unset the user, group and role

Returns
void

Implements BristolSU\Support\Authentication\Contracts\Authentication.

Definition at line 158 of file SessionAuthentication.php.

◆ setGroup()

BristolSU\Support\Testing\Authentication\SessionAuthentication::setGroup ( Group  $group)

Set the group

Parameters
Group$group
Returns
void

Implements BristolSU\Support\Authentication\Contracts\Authentication.

Definition at line 126 of file SessionAuthentication.php.

◆ setRole()

BristolSU\Support\Testing\Authentication\SessionAuthentication::setRole ( Role  $role)

Set the role

Parameters
Role$role
Returns
void

Implements BristolSU\Support\Authentication\Contracts\Authentication.

Definition at line 137 of file SessionAuthentication.php.

◆ setUser()

BristolSU\Support\Testing\Authentication\SessionAuthentication::setUser ( User  $user)

Set the user

Parameters
User$user
Returns
void

Implements BristolSU\Support\Authentication\Contracts\Authentication.

Definition at line 148 of file SessionAuthentication.php.

Member Data Documentation

◆ $groupRepository

BristolSU\Support\Testing\Authentication\SessionAuthentication::$groupRepository
private

◆ $roleRepository

BristolSU\Support\Testing\Authentication\SessionAuthentication::$roleRepository
private

◆ $session

BristolSU\Support\Testing\Authentication\SessionAuthentication::$session
private

◆ $userRepository

BristolSU\Support\Testing\Authentication\SessionAuthentication::$userRepository
private

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