AbstractBaseDto
in package
AbstractYes
Table of Contents
Properties
- $apiPropertyName : string
- The name of the property in the API
Methods
- __construct() : mixed
- BaseDto constructor.
- toApiArray() : array<string|int, mixed>
- Convert the DTO to an array for API requests
- toArray() : array<string|int, mixed>
- Convert the DTO to an array
- cast() : DateTime|mixed
- Cast the value to the correct type
Properties
$apiPropertyName
The name of the property in the API
protected
string
$apiPropertyName
= ''
Methods
__construct()
BaseDto constructor.
public
__construct(array<string|int, mixed> $data) : mixed
Parameters
- $data : array<string|int, mixed>
Tags
toApiArray()
Convert the DTO to an array for API requests
public
toApiArray() : array<string|int, mixed>
Return values
array<string|int, mixed>toArray()
Convert the DTO to an array
public
toArray() : array<string|int, mixed>
Return values
array<string|int, mixed>cast()
Cast the value to the correct type
private
cast(mixed $value, string $key) : DateTime|mixed
Parameters
- $value : mixed
- $key : string