class PrepareEvent extends Event

Class PrepareEvent

Properties

protected Kernel $apiKernel from Event
protected ProviderInterface $apiProvider from Event
protected array $apiRequest from Event

Methods

__construct(ProviderInterface $apiProvider, array $apiRequest, Kernel $apiKernel)

No description

from Event
getApiKernel()

Get api kernel.

from Event
getApiProvider()

No description

from Event
array
getApiRequest()

No description

from Event
string
getApiRequestSig()

Create a brief string identifying the entity/action. Useful for pithy matching/switching.

from Event
setApiRequest(array $apiRequest)

No description

wrapApi(callable $callback)

Replace the normal implementation of an API call with some wrapper.

Details

in Event at line 62
__construct(ProviderInterface $apiProvider, array $apiRequest, Kernel $apiKernel)

Parameters

ProviderInterface $apiProvider The API responsible for executing the request.
array $apiRequest The full description of the API request.
Kernel $apiKernel

in Event at line 73
Kernel getApiKernel()

Get api kernel.

Return Value

Kernel

in Event at line 80
ProviderInterface getApiProvider()

Return Value

ProviderInterface

in Event at line 87
array getApiRequest()

Return Value

array

in Event at line 100
string getApiRequestSig()

Create a brief string identifying the entity/action. Useful for pithy matching/switching.

Ex: if ($e->getApiRequestSig() === '3.contact.get') { ... }

Return Value

string Ex: '3.contact.get'

at line 42
PrepareEvent setApiRequest(array $apiRequest)

Parameters

array $apiRequest The full description of the API request.

Return Value

PrepareEvent

at line 66
PrepareEvent wrapApi(callable $callback)

Replace the normal implementation of an API call with some wrapper.

The wrapper has discretion to call -- or not call -- or iterate with -- the original API implementation, with original or substituted arguments.

Ex:

$event->wrapApi(function($apiRequest, $continue){ echo "Hello\n"; $continue($apiRequest); echo "Goodbye\n"; });

Parameters

callable $callback The custom API implementation. Function(array $apiRequest, callable $continue).

Return Value

PrepareEvent