Download the PHP package andrey-helldar/simple-data-transfer-object without Composer
On this page you can find all versions of the php package andrey-helldar/simple-data-transfer-object. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download andrey-helldar/simple-data-transfer-object
More information about andrey-helldar/simple-data-transfer-object
Files in andrey-helldar/simple-data-transfer-object
Package simple-data-transfer-object
Short Description Simple Data Transfer Objects
License MIT
Informations about the package simple-data-transfer-object
Simple Data Transfer Object
[!TIP] Use the
spatie/laravel-datainstead.
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.jsonfile; - Replace
Helldar\SimpleDataTransferObjectnamespace prefix withDragonCode\SimpleDataTransferObjectin your application; - Call the
composer updateconsole command.
Upgrade from dragon-code/simple-data-transfer-object
- Replace
dragon-code/simple-data-transfer-objectwithdragon-code/simple-dtoin thecomposer.jsonfile; - Call the
composer updateconsole 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-data-transfer-object 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