Download the PHP package dragon-code/simple-dto without Composer
On this page you can find all versions of the php package dragon-code/simple-dto. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download dragon-code/simple-dto
More information about dragon-code/simple-dto
Files in dragon-code/simple-dto
Informations about the package simple-dto
Simple Data Transfer Object
Installation
To get the latest version of Simple Data Transfer Object
, simply require the project using Composer:
Or manually update require
block of composer.json
and run composer update
.
Upgrade from andrey-helldar/simple-data-transfer-object
- Replace
"andrey-helldar/simple-data-transfer-object": "^1.0"
with"dragon-code/simple-dto": "^2.0"
in thecomposer.json
file; - Replace
Helldar\SimpleDataTransferObject
namespace prefix withDragonCode\SimpleDataTransferObject
in your application; - Call the
composer update
console command.
Upgrade from dragon-code/simple-data-transfer-object
- Replace
dragon-code/simple-data-transfer-object
withdragon-code/simple-dto
in thecomposer.json
file; - Call the
composer update
console command.
Using
Basic
Mappings
Casts
Nested Objects
With the help of casts, you can also easily create nested objects:
For example, casting test company object:
From
Array
Json
Object
Request
Get And Set
You can use the get
and set
methods in your app:
Helpers
For your convenience, starting from version 2.17 of
the dragon-code/contracts
package, we have added a new interface that declares the implementation of the
public dto
method. This way you can better control your application to return DTO objects.
Of course, don't forget to implement the interface 😉
For example:
All versions of simple-dto with dependencies
ext-json Version *
dragon-code/contracts Version ^2.17
dragon-code/support Version ^5.0 || ^6.0
symfony/http-foundation Version ^4.0 || ^5.0 || ^6.0 || ^7.0