PHPackages                             konstantin-kuklin/doctrine-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. konstantin-kuklin/doctrine-dto

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

konstantin-kuklin/doctrine-dto
==============================

161391PHP

Since Jul 12Pushed 10y ago1 watchersCompare

[ Source](https://github.com/KonstantinKuklin/DoctrineDto)[ Packagist](https://packagist.org/packages/konstantin-kuklin/doctrine-dto)[ RSS](/packages/konstantin-kuklin-doctrine-dto/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

DoctrineDto
===========

[](#doctrinedto)

[![Build Status](https://camo.githubusercontent.com/6d402f8dbcf6ca1c8802ba2c6bbe94cc95ccd3ae6e4250cf8f4675830698707c/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f4b6f6e7374616e74696e4b756b6c696e2f446f637472696e6544746f2e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/KonstantinKuklin/DoctrineDto)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/45d0fc211fc70183ecb05b2e7283693fee2fbcdab94f902a3a84a499e31a7b44/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f4b6f6e7374616e74696e4b756b6c696e2f446f637472696e6544746f2f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/KonstantinKuklin/DoctrineDto/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/9d2b1c7a3c04d72665e7a5276e858ec6e60b901b2f6c01c9cc0ee41c928e6e01/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f4b6f6e7374616e74696e4b756b6c696e2f446f637472696e6544746f2f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/KonstantinKuklin/DoctrineDto/?branch=master)[![GitHub release](https://camo.githubusercontent.com/4817a212ea7bd924bd87467dbfd0a4fcefba7de928559f377371980470a64b4d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f4b6f6e7374616e74696e4b756b6c696e2f446f637472696e6544746f2e737667)](https://github.com/KonstantinKuklin/DoctrineDto/releases/latest)[![Total Downloads](https://camo.githubusercontent.com/a5184ceb657a2b2da6f3d6e278ad8956f7207467cd697ac8508768007dcb64a6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6b6f6e7374616e74696e2d6b756b6c696e2f646f637472696e652d64746f2e737667)](https://packagist.org/packages/konstantin-kuklin/doctrine-dto)[![Daily Downloads](https://camo.githubusercontent.com/be4794679556bc3611531bd7eac9b9a5f81125b7bb58cca8d6c12ce0a5081b5e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64642f6b6f6e7374616e74696e2d6b756b6c696e2f646f637472696e652d64746f2e737667)](https://packagist.org/packages/konstantin-kuklin/doctrine-dto)[![Minimum PHP Version](https://camo.githubusercontent.com/15652a39c31b79c4255f80c0ff59e65c6242b52bfe8cab3b6362d3d18d0df831/687474703a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230352e332d3838393242462e737667)](https://php.net/)[![License](https://camo.githubusercontent.com/903458eac950530156911e613d29ddc7e8046c72bc0e797ed0cbad7b9e3b2d66/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6b6f6e7374616e74696e2d6b756b6c696e2f646f637472696e652d64746f2e737667)](https://packagist.org/packages/konstantin-kuklin/doctrine-dto)

What is DoctrineDto?
--------------------

[](#what-is-doctrinedto)

Library for getting Data Transfer Object from a database through Doctrine. If you are using a service approach to development, this library can be useful for you.

Requirements
------------

[](#requirements)

Single dependency: Doctrine orm library Also you need to have PHP &gt;= 5.3

Installation
------------

[](#installation)

The simplest way to add DoctrineDto is execute command:

```
composer require "konstantin-kuklin/doctrine-dto" "dev-master"

```

Usage example
-------------

[](#usage-example)

Initialize Dto -&gt; Entity class map:

```
// static map rules here:
$map = new Map(
    array(
        'Path\To\UserEntity' => 'Path\To\UserDto',
        'Path\To\AnotherEntity' => 'Path\To\AnotherDto'
    )
);
// class to dynamic class map generation
$map->addMapGeneratorElement(new EntityDtoSimpleGenerator());

// set class map
DtoClassMap::setMap($map, $map->getFlippedMap());
```

Add custom hydrator in your code with such example:

```
$em->getConfiguration()->addCustomHydrationMode('DtoHydrator', 'KonstantinKuklin\DoctrineDto\Hydrator\DtoHydrator');
$query = $em->createQuery('SELECT u FROM CmsUser u');
$results = $query->getResult('DtoHydrator');
```

Usage with Symfony
------------------

[](#usage-with-symfony)

For using with Symfony framework go to [DoctrineDtoBundle](https://github.com/KonstantinKuklin/DoctrineDtoBundle).

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/14bf2bc19526615387e37a0e04bb5110ec344663a6bc8e95c3b9947cd5b9808c?d=identicon)[KonstantinKuklin](/maintainers/KonstantinKuklin)

---

Top Contributors

[![KonstantinKuklin](https://avatars.githubusercontent.com/u/573586?v=4)](https://github.com/KonstantinKuklin "KonstantinKuklin (4 commits)")

### Embed Badge

![Health badge](/badges/konstantin-kuklin-doctrine-dto/health.svg)

```
[![Health](https://phpackages.com/badges/konstantin-kuklin-doctrine-dto/health.svg)](https://phpackages.com/packages/konstantin-kuklin-doctrine-dto)
```

###  Alternatives

[boehm_s/fun

Functional programming utilities for PHP

301.8k](/packages/boehm-s-fun)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
