RequestContext
class RequestContext
Constants
| protected VALUES_CONTEXT_KEY |
|
Methods
Determine if a request exists in context.
Remove the request from context.
Get the current request from context, or null if not set.
Retrieve a value scoped to the current request.
Store a value until the request is replaced or forgotten.
Remove a value scoped to the current request.
Retrieve a request-scoped value, storing the supplied value when missing.
Details
at line 19
static Request
get(int|null $coroutineId = null)
Get the current request from context.
at line 29
static Request
set(Request $request, int|null $coroutineId = null)
Set the current request in context.
Replacing the request clears the coroutine's internal request-scoped caches.
at line 41
static bool
has(int|null $coroutineId = null)
Determine if a request exists in context.
at line 51
static void
forget(int|null $coroutineId = null)
Remove the request from context.
Also clear the coroutine's internal request-scoped caches.
at line 60
static Request|null
getOrNull(int|null $coroutineId = null)
Get the current request from context, or null if not set.
at line 70
static mixed
getValue(UnitEnum|string $key, mixed $default = null, int|null $coroutineId = null)
| internal | framework cache storage; use request attributes for application request metadata |
Retrieve a value scoped to the current request.
at line 82
static mixed
setValue(UnitEnum|string $key, mixed $value, int|null $coroutineId = null)
| internal | framework cache storage; use request attributes for application request metadata |
Store a value until the request is replaced or forgotten.
at line 97
static void
forgetValue(UnitEnum|string $key, int|null $coroutineId = null)
| internal | framework cache storage; use request attributes for application request metadata |
Remove a value scoped to the current request.
at line 112
static mixed
getOrSetValue(UnitEnum|string $key, mixed $value, int|null $coroutineId = null)
| internal | framework cache storage; use request attributes for application request metadata |
Retrieve a request-scoped value, storing the supplied value when missing.