Class ClientEvent
Class Client Event
Property Summary
Method Summary
-
__construct() public
Constructor
-
getAdapterOptions() public
Get the adapter options.
-
getData() public
Accesses the event data/payload.
-
getName() public
Returns the name of this event. This is usually used as the event identifier
-
getRequest() public
Get the request instance.
-
getResult() public
The result value of the event listeners
-
getSubject() public
Returns the subject of this event
If the event has no subject an exception will be raised.
-
isStopped() public
Check if the event is stopped
-
setAdapterOptions() public
Set the adapter options.
-
setData() public
Assigns a value to the data/payload of this event.
-
setRequest() public
Set request instance.
-
setResult() public
Listeners can attach a result value to the event.
-
stopPropagation() public
Stops the event from being used anymore
Method Detail
__construct() ¶ public
__construct(string $name, Cake\Http\Client $subject, array $data = [])
Constructor
Parameters
-
string$name Name of the event
-
Cake\Http\Client$subject The Http Client instance this event applies to.
-
array$data optional Any value you wish to be transported with this event to it can be read by listeners.
getAdapterOptions() ¶ public
getAdapterOptions(): array<string, mixed>
Get the adapter options.
Returns
array<string, mixed>getData() ¶ public
getData(string|null $key = null): $key is null ? array : mixed
Accesses the event data/payload.
Parameters
-
string|null$key optional
Returns
$key is null ? array : mixedgetName() ¶ public
getName(): string
Returns the name of this event. This is usually used as the event identifier
Returns
stringgetRequest() ¶ public
getRequest(): Psr\Http\Message\RequestInterface
Get the request instance.
Returns
Psr\Http\Message\RequestInterfacegetResult() ¶ public
getResult(): Cake\Http\Client\Response|null
The result value of the event listeners
Returns
Cake\Http\Client\Response|nullgetSubject() ¶ public
getSubject(): TSubject|null
Returns the subject of this event
If the event has no subject an exception will be raised.
Returns
TSubject|nullThrows
Cake\Core\Exception\CakeExceptionisStopped() ¶ public
isStopped(): bool
Check if the event is stopped
Returns
boolTrue if the event is stopped
setAdapterOptions() ¶ public
setAdapterOptions(array<string, mixed> $options = []): $this
Set the adapter options.
Parameters
-
array<string, mixed>$options optional Options for the adapter.
Returns
$thissetData() ¶ public
setData(array|string $key, mixed $value = null): $this
Assigns a value to the data/payload of this event.
Parameters
-
array|string$key -
mixed$value optional
Returns
$thissetRequest() ¶ public
setRequest(Psr\Http\Message\RequestInterface $request): $this
Set request instance.
Parameters
-
Psr\Http\Message\RequestInterface$request
Returns
$thissetResult() ¶ public
setResult(mixed $value = null): $this
Listeners can attach a result value to the event.
Parameters
-
mixed$value optional The value to set.
Returns
$thisstopPropagation() ¶ public
stopPropagation(): void
Stops the event from being used anymore
Returns
void