CSTokenAppContext
extends CSTokenRestContext
in package
This class represents a concrete token context
Tags
Table of Contents
- __toString() : string
- Generates the string representation of the token context.
- check() : bool
- Checks if the token context instance is valid for the current context.
- createForAppContext() : CSTokenAppContext
- Initializes the context with valid apps.
- createForModuleContext() : CSTokenModuleContext
- Initializes the context with the matching module name.
- createForRestContext() : CSTokenRestContext
- Initializes the token context with valid endpoints.
- createFromDefinition() : CSTokenContext
- Restores a token context from the definition stored in the string representation.
- setApps() : void
- Sets the apps that are valid for this context.
- setEndpoints() : void
- Sets the valid endpoints for this context.
- setModule() : void
- Sets the module name for this context.
Methods
__toString()
Generates the string representation of the token context.
public
final __toString() : string
Tags
Return values
string —String representation of the token context.
check()
Checks if the token context instance is valid for the current context.
public
final check() : bool
Tags
Return values
bool —True, if token context matches the context, otherwise false.
createForAppContext()
Initializes the context with valid apps.
public
static createForAppContext(array<string|int, mixed> $aApps) : CSTokenAppContext
Parameters
- $aApps : array<string|int, mixed>
Tags
Return values
CSTokenAppContext —The token context instance.
createForModuleContext()
Initializes the context with the matching module name.
public
final static createForModuleContext(string $sModule) : CSTokenModuleContext
Parameters
- $sModule : string
-
The module name valid for this context.
Tags
Return values
CSTokenModuleContext —The concrete token context instance.
createForRestContext()
Initializes the token context with valid endpoints.
public
static createForRestContext(array<string|int, mixed> $aEndpoints) : CSTokenRestContext
Parameters
- $aEndpoints : array<string|int, mixed>
-
The valid endpoints for this context.
Tags
Return values
CSTokenRestContext —The concrete token context.
createFromDefinition()
Restores a token context from the definition stored in the string representation.
public
final static createFromDefinition(array<string|int, mixed> $aDefinition) : CSTokenContext
Parameters
- $aDefinition : array<string|int, mixed>
-
The token context definition retrieved from string representation.
Tags
Return values
CSTokenContext —A concrete instance of CSToken Context.
setApps()
Sets the apps that are valid for this context.
public
setApps(array<string|int, mixed> $aApps) : void
Parameters
- $aApps : array<string|int, mixed>
Tags
Return values
void —setEndpoints()
Sets the valid endpoints for this context.
public
setEndpoints(array<string|int, mixed> $aEndpoints) : void
Parameters
- $aEndpoints : array<string|int, mixed>
-
The valid enpoints for this context.
Tags
Return values
void —setModule()
Sets the module name for this context.
public
setModule(string $sModule) : void
Parameters
- $sModule : string
-
The module name for this context.
