OCMEndpointRequestEvent
extends Event
in package
Use this event to catch and manage incoming OCM request
Tags
Attributes
- #[Listenable]
- $since: '33.0.0'
Table of Contents
Properties
- $capability : string
- $method : string
- $path : string
- $payload : array<string|int, mixed>|null
- $remote : string|null
- $response : Response|null
Methods
- __construct() : mixed
- Compatibility constructor
- getArgs() : array<string|int, mixed>
- Returns the list of parameters from the request, post-'capability'
- getArgsCount() : int
- return the number of parameters found in the subpath
- getPath() : string
- returns the sub-path (post-/ocm/) of the request will start with a slash ('/')
- getPayload() : array<string|int, mixed>
- returns the payload attached to the request
- getRemote() : string|null
- returns the origin of the request, if signed.
- getRequestedCapability() : string
- returns the first parameter of the sub-path (post-/ocm/) from the request
- getResponse() : Response|null
- getUsedMethod() : string
- returns the method used
- isPropagationStopped() : bool
- {@inheritDoc}
- isSigned() : bool
- setResponse() : void
- set the Response to the Request to be sent to requester
- stopPropagation() : void
- Stops the propagation of the event to further event listeners
Properties
$capability
private
string
$capability
= ''
$method read-only
private
string
$method
$path
private
string
$path
$payload read-only
private
array<string|int, mixed>|null
$payload
= null
$remote read-only
private
string|null
$remote
= null
$response
private
Response|null
$response
= null
Methods
__construct()
Compatibility constructor
public
__construct(string $method, string $path[, array<string|int, mixed>|null $payload = null ][, string|null $remote = null ]) : mixed
Parameters
- $method : string
- $path : string
- $payload : array<string|int, mixed>|null = null
- $remote : string|null = null
Tags
getArgs()
Returns the list of parameters from the request, post-'capability'
public
getArgs(ParamType ...$params) : array<string|int, mixed>
If no ParamType is specified as parameter of the method, the returned array will contain all entries (all string).
If one or multiple ParamType are set:
- the returned array will contain as many entries as the number of ParamType,
- each value from the returned array will be typed based on set ParamType,
- if ParamType cannot be applied (i.e., only alphabetic chars while expecting integer), value will be NULL,
- if missing elements to the request path, missing entries will be NULL,
Parameters
- $params : ParamType
Tags
Return values
array<string|int, mixed>getArgsCount()
return the number of parameters found in the subpath
public
getArgsCount() : int
Tags
Return values
intgetPath()
returns the sub-path (post-/ocm/) of the request will start with a slash ('/')
public
getPath() : string
Tags
Return values
stringgetPayload()
returns the payload attached to the request
public
getPayload() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed>getRemote()
returns the origin of the request, if signed.
public
getRemote() : string|null
Tags
Return values
string|null —NULL if request is not authed
getRequestedCapability()
returns the first parameter of the sub-path (post-/ocm/) from the request
public
getRequestedCapability() : string
Tags
Return values
stringgetResponse()
public
getResponse() : Response|null
Tags
Return values
Response|nullgetUsedMethod()
returns the method used
public
getUsedMethod() : string
Tags
Return values
stringisPropagationStopped()
{@inheritDoc}
public
isPropagationStopped() : bool
Tags
Return values
boolisSigned()
public
isSigned() : bool
Tags
Return values
bool —TRUE if request is signed
setResponse()
set the Response to the Request to be sent to requester
public
setResponse(Response $response) : void
Parameters
- $response : Response
Tags
stopPropagation()
Stops the propagation of the event to further event listeners
public
stopPropagation() : void