Nextcloud PHP API (master)

OCMEndpointRequestEvent extends Event
in package

FinalYes

Use this event to catch and manage incoming OCM request

Tags
since
33.0.0
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

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
since
33.0.0

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
since
33.0.0
Return values
array<string|int, mixed>

getArgsCount()

return the number of parameters found in the subpath

public getArgsCount() : int
Tags
since
33.0.0
Return values
int

getPath()

returns the sub-path (post-/ocm/) of the request will start with a slash ('/')

public getPath() : string
Tags
since
33.0.0
Return values
string

getPayload()

returns the payload attached to the request

public getPayload() : array<string|int, mixed>
Tags
since
33.0.0
Return values
array<string|int, mixed>

getRemote()

returns the origin of the request, if signed.

public getRemote() : string|null
Tags
since
33.0.0
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
since
33.0.0
Return values
string

getUsedMethod()

returns the method used

public getUsedMethod() : string
Tags
since
33.0.0
Return values
string

isPropagationStopped()

{@inheritDoc}

public isPropagationStopped() : bool
Tags
since
22.0.0
see
StoppableEventInterface
Return values
bool

isSigned()

public isSigned() : bool
Tags
since
33.0.0
Return values
bool

TRUE if request is signed

stopPropagation()

Stops the propagation of the event to further event listeners

public stopPropagation() : void
Tags
since
22.0.0

        
On this page

Search results