PayloadCopy
in package
implements
ArrayAccess, Countable
PayloadCopy Class
This class represents a copy of payload data received in a web request. It implements the ArrayAccess and Countable interfaces for array-like behavior.
Table of Contents
Interfaces
- ArrayAccess
- Countable
Properties
- $_payloadData : mixed
- $_type : string
Methods
- __construct() : mixed
- Constructor.
- __get() : mixed
- Magic getter method.
- count() : int
- Get the number of keys in the array.
- offsetExists() : bool
- Check if data exists at the specified offset.
- offsetGet() : mixed
- Get the value at the specified offset.
- offsetSet() : void
- Set the value at the specified offset.
- offsetUnset() : void
- Unset data at the specified offset.
- ToArray() : array<string|int, mixed>
- Convert the payload data to an array.
- _loadPayload() : void
- Load the payload data.
Properties
$_payloadData
private
mixed
$_payloadData
= null
$_type
private
string
$_type
Methods
__construct()
Constructor.
public
__construct(string $type) : mixed
Parameters
- $type : string
-
The type of payload data (e.g., json, xml).
__get()
Magic getter method.
public
__get(string $property) : mixed
Parameters
- $property : string
-
The property name.
Return values
mixed —The value of the property.
count()
Get the number of keys in the array.
public
count() : int
Return values
int —The number of keys in the array.
offsetExists()
Check if data exists at the specified offset.
public
offsetExists(mixed $offset) : bool
Parameters
- $offset : mixed
-
The offset.
Return values
bool —True if data exists, false otherwise.
offsetGet()
Get the value at the specified offset.
public
offsetGet(mixed $offset) : mixed
Parameters
- $offset : mixed
-
The offset.
Return values
mixed —The value at the specified offset.
offsetSet()
Set the value at the specified offset.
public
offsetSet(mixed $offset, mixed $value) : void
Parameters
- $offset : mixed
-
The offset.
- $value : mixed
-
The value.
offsetUnset()
Unset data at the specified offset.
public
offsetUnset(mixed $offset) : void
Parameters
- $offset : mixed
-
The offset.
ToArray()
Convert the payload data to an array.
public
ToArray() : array<string|int, mixed>
Return values
array<string|int, mixed> —The payload data as an array.
_loadPayload()
Load the payload data.
private
_loadPayload() : void