BaseDto
in package
implements
Arrayable
PHP Mini Framework
Tags
Interfaces, Classes, Traits and Enums
- Arrayable
- PHP Mini Framework
Table of Contents
- 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
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