PHPackages                             aedart/dto - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. aedart/dto

Abandoned → [aedart/athenaeum](/?search=aedart%2Fathenaeum)ArchivedLibrary[Utility &amp; Helpers](/categories/utility)

aedart/dto
==========

A variation / interpretation of the Data Transfer Object (DTO) design pattern (Distribution Pattern). Provides an abstraction for such DTOs

5.1.0(7y ago)2711.9k↓25%41BSD-3-ClausePHPPHP &gt;=7.1.0

Since Sep 6Pushed 7y ago3 watchersCompare

[ Source](https://github.com/aedart/data-transfer-object-dto)[ Packagist](https://packagist.org/packages/aedart/dto)[ Docs](https://github.com/aedart/data-transfer-object-dto)[ RSS](/packages/aedart-dto/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (8)Versions (14)Used By (1)

[![Build Status](https://camo.githubusercontent.com/bce663be1658361836bb58ed819a04087e35c85a53fa770db708897c64530ddd/68747470733a2f2f7472617669732d63692e6f72672f6165646172742f646174612d7472616e736665722d6f626a6563742d64746f2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/aedart/data-transfer-object-dto)[![Latest Stable Version](https://camo.githubusercontent.com/baafe3497bfcd36ae5863358c893e9db7e4c66bbb4d422de2fd774962b62c195/68747470733a2f2f706f7365722e707567782e6f72672f6165646172742f64746f2f762f737461626c65)](https://packagist.org/packages/aedart/dto)[![Total Downloads](https://camo.githubusercontent.com/dace3742855a113f064560986ae09cb95b28de46f02c30e1efb52b1e614eb133/68747470733a2f2f706f7365722e707567782e6f72672f6165646172742f64746f2f646f776e6c6f616473)](https://packagist.org/packages/aedart/dto)[![Latest Unstable Version](https://camo.githubusercontent.com/171f3c3c07d9aaadb81ca7671f9d7787cd8342cc8430776b4f0f50334b8781b3/68747470733a2f2f706f7365722e707567782e6f72672f6165646172742f64746f2f762f756e737461626c65)](https://packagist.org/packages/aedart/dto)[![License](https://camo.githubusercontent.com/b4530b40a8a2d35391b7511b8dc65be991a1b74094bd22882ae6478d76f90279/68747470733a2f2f706f7365722e707567782e6f72672f6165646172742f64746f2f6c6963656e7365)](https://packagist.org/packages/aedart/dto)

Deprecated - Data Transfer Object (DTO)
=======================================

[](#deprecated---data-transfer-object-dto)

Package has been replaced by [aedart/athenaeum](https://github.com/aedart/athenaeum)

A variation / interpretation of the Data Transfer Object (DTO) design pattern (Distribution Pattern). A DTO is nothing more than an object that can hold some data. Most commonly it is used for for transporting that data between systems, e.g. a client and a server.

This package provides an abstraction for such DTOs.

If you don't know about DTOs, I recommend you to read [Martin Fowler's description](http://martinfowler.com/eaaCatalog/dataTransferObject.html) of DTO, and perhaps perform a few [Google searches](https://www.google.com/search?q=data+transfer+object&ie=utf-8&oe=utf-8) about this topic.

Contents
--------

[](#contents)

- [When to use this](#when-to-use-this)
- [How to install](#how-to-install)
- [Quick start](#quick-start)
- [Advanced usage](#advanced-usage)
- [Contribution](#contribution)
- [Acknowledgement](#acknowledgement)
- [Versioning](#versioning)
- [License](#license)

When to use this
----------------

[](#when-to-use-this)

- When there is a strong need to interface DTOs, e.g. what properties must be available via getters and setters
- When you need to encapsulate data that needs to be communicated between systems and or component instances

Nevertheless, using DTOs can / will increase complexity of your project. Therefore, you should only use it, when you are really sure that you need them.

How to install
--------------

[](#how-to-install)

```
composer require aedart/dto
```

This package uses [composer](https://getcomposer.org/). If you do not know what that is or how it works, I recommend that you read a little about, before attempting to use this package.

Quick start
-----------

[](#quick-start)

### Custom Interface for your DTO

[](#custom-interface-for-your-dto)

Start off by creating an interface for your DTO. Below is an example for a simple Person interface

```
