Request
extends Request
in package
This method extends the Symfony request class to add more functionality to the request object.
All methods on the request object are still available in this class. But more methods have been added to the request object.
Tags
Table of Contents
Properties
- $auth : ContextUserObject|null
- $authenticated : bool
- $context : mixed
- $auth : ContextUserObject|null
- $authenticated : bool
- $context : mixed
Methods
- getAuth() : ContextUserObject|null
- The currently logged user in context object
- getContext() : mixed
- This is the entire app context object, it even contains the authentication object itself.
- getData() : array<string|int, mixed>
- Merges data sent from the client as json and form data as one array where one can access all the request data.
- getFileByName() : FileBag|null
- Returns the file from the request if the request was submitted as form data
- isAuthenticated() : bool
- This method checks if the request is authenticated
- setAuthenticationContext() : $this
- This method sets the authentication context for the request
- setAppContext() : $this
- This method add data to the context object
Properties
$auth
public
ContextUserObject|null
$auth
The currently logged user in context object
$authenticated
public
bool
$authenticated
Whether the request is authenticated or not
$context
public
mixed
$context
The entire app context object
$auth
private
ContextUserObject|null
$auth
= null
$authenticated
private
bool
$authenticated
= false
$context
private
mixed
$context
= null
Methods
getAuth()
The currently logged user in context object
public
getAuth() : ContextUserObject|null
Return values
ContextUserObject|null —The currently logged in user object or null if no user is logged in
getContext()
This is the entire app context object, it even contains the authentication object itself.
public
getContext() : mixed
getData()
Merges data sent from the client as json and form data as one array where one can access all the request data.
public
getData() : array<string|int, mixed>
This implies that this request is safe for both json and form data scenarios
Return values
array<string|int, mixed>getFileByName()
Returns the file from the request if the request was submitted as form data
public
getFileByName( $fileName) : FileBag|null
Parameters
Return values
FileBag|nullisAuthenticated()
This method checks if the request is authenticated
public
isAuthenticated() : bool
Return values
bool —Whether the request is authenticated or not
setAuthenticationContext()
This method sets the authentication context for the request
public
setAuthenticationContext(ContextUserObject $userObject) : $this
Parameters
- $userObject : ContextUserObject
Return values
$thissetAppContext()
This method add data to the context object
private
setAppContext([array<string|int, mixed> $contextData = [] ]) : $this
Parameters
- $contextData : array<string|int, mixed> = []
-
The context data to be added to the request