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

Public Member Functions

 __construct (Authentication $authentication)
 
 fromString (string $resourceType)
 

Private Attributes

 $authentication
 

Detailed Description

Generates a resource ID from the authenticatoin

Definition at line 11 of file AuthenticationResourceIdGenerator.php.

Constructor & Destructor Documentation

◆ __construct()

BristolSU\Support\Authentication\AuthenticationResourceIdGenerator::__construct ( Authentication  $authentication)

Initialise the authentication resource id generator

Parameters
Authentication$authenticationAuthentication implementation

Definition at line 26 of file AuthenticationResourceIdGenerator.php.

References BristolSU\Support\Authentication\AuthenticationResourceIdGenerator\$authentication.

Member Function Documentation

◆ fromString()

BristolSU\Support\Authentication\AuthenticationResourceIdGenerator::fromString ( string  $resourceType)

Generate a resource id

Passing a resource type (user, group or role) will get the corresponding model from authentication and return the id

Parameters
string$resourceTypeUser, group or role
Returns
int ID of the authenticated model
Exceptions

Implements BristolSU\Support\Authentication\Contracts\ResourceIdGenerator.

Definition at line 41 of file AuthenticationResourceIdGenerator.php.

Member Data Documentation

◆ $authentication

BristolSU\Support\Authentication\AuthenticationResourceIdGenerator::$authentication
private

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