ResponseDto
extends BaseDto
in package
PHP Mini Framework
Tags
Table of Contents
- $backtrace : array<string|int, mixed>
- $code : string
- $data : object|array<string|int, mixed>
- $duration : int
- $env : string
- $file : string
- $ip : string
- $line : string
- $message : string
- $success : bool
- $version : string
- load() : self
- Load data from array
- parseType() : mixed
- Parse object type
- resolveType() : string
- Resolve data type
- toArray() : array<string|int, mixed>
- Get array response data
- with() : static
- Load dto with array
Properties
$backtrace
public
array<string|int, mixed>
$backtrace
Tags
$code
public
string
$code
Tags
$data
public
object|array<string|int, mixed>
$data
Tags
$duration
public
int
$duration
Tags
$env
public
string
$env
Tags
$file
public
string
$file
Tags
$ip
public
string
$ip
Tags
$line
public
string
$line
Tags
$message
public
string
$message
Tags
$success
public
bool
$success
Tags
$version
public
string
$version
Tags
Methods
load()
Load data from array
public
load(array<string|int, mixed> $data[, bool $force = false ]) : self
Parameters
- $data : array<string|int, mixed>
- $force : bool = false
Tags
Return values
self —parseType()
Parse object type
public
static parseType(ReflectionUnionType|ReflectionNamedType|ReflectionType|string $type, mixed $data) : mixed
Parameters
- $type : ReflectionUnionType|ReflectionNamedType|ReflectionType|string
- $data : mixed
Tags
Return values
mixed —resolveType()
Resolve data type
public
static resolveType(mixed $data[, array<string|int, ReflectionNamedType> $types = [] ]) : string
Parameters
- $data : mixed
- $types : array<string|int, ReflectionNamedType> = []
Tags
Return values
string —toArray()
Get array response data
public
toArray([bool $trim = true ]) : array<string|int, mixed>
Parameters
- $trim : bool = true
-
Remove NULL properties
Tags
Return values
array<string|int, mixed> —with()
Load dto with array
public
static with(array<string|int, mixed>|object|null $data) : static
Parameters
- $data : array<string|int, mixed>|object|null