PHPackages                             liuggio/filler-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. liuggio/filler-dto

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

liuggio/filler-dto
==================

Retrieve and set properties from and to a DTO

0.1.0(10y ago)7105.4k—0%11MITPHPPHP &gt;=5.3.2

Since Aug 28Pushed 10y ago1 watchersCompare

[ Source](https://github.com/liuggio/filler-dto)[ Packagist](https://packagist.org/packages/liuggio/filler-dto)[ RSS](/packages/liuggio-filler-dto/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (2)Versions (4)Used By (1)

Filler
======

[](#filler)

**It helps you to bridge DTOs and Model Entities.**

Fill or retrieve properties from and to [DTO](http://en.wikipedia.org/wiki/Data_transfer_object) objects!

`filler-dto` on packagist

[![Latest Stable Version](https://camo.githubusercontent.com/bd5feb5e08f4f7a9f6bcafb40f6b0d3be97bf33659455727d807e949e240e0a6/68747470733a2f2f706f7365722e707567782e6f72672f6c69756767696f2f66696c6c65722d64746f2f76657273696f6e2e737667)](https://packagist.org/packages/liuggio/filler-dto) [![Latest Unstable Version](https://camo.githubusercontent.com/ec736b38c61e1b6105e4b35447ff947c60265075b4e3879e2b2fb6ff7d5b2b5e/68747470733a2f2f706f7365722e707567782e6f72672f6c69756767696f2f66696c6c65722d64746f2f762f756e737461626c652e737667)](//packagist.org/packages/liuggio/filler-dto) [![Total Downloads](https://camo.githubusercontent.com/157ffdd00ad810a372568b6545d9ac9fc9e5d8451022ba8f2f643896300f53e1/68747470733a2f2f706f7365722e707567782e6f72672f6c69756767696f2f66696c6c65722d64746f2f646f776e6c6f6164732e737667)](https://packagist.org/packages/liuggio/filler-dto)

Fast
----

[](#fast)

It doesn't use the \\Reflection.

Before the Cure
---------------

[](#before-the-cure)

```
class Cart
{
    private $a;
    private $b;
    private $c;

    private function __construct($a, $b, $c)
    {
        $this->a = $a;
        $this->b = $b;
        $this->c = $c;
    }

    public static function startShipping(StartShippingData $data)
    {
        return new self($data->a, $data->b, null);
    }

    public static function addProduct(AddProductData $data)
    {
        return new self(null, $data->b, $data->cs);
    }
}
```

After the Cure
--------------

[](#after-the-cure)

```
class Cart
{
    use PropertyTrait;

    private $a;
    private $b;
    private $c;

    private function __construct($dto)
    {
        $this->fillProperties($dto);
    }

    public static function startShipping(StartShippingData $data)
    {
        return new self($data);
    }

    public static function addProduct(AddProductData $data)
    {
        return new self($data);
    }
}

class StartShippingData
{
    public $a;
    public $b;
}

class AddProductData
{
    public $b;
    public $c;
}
```

From Request
------------

[](#from-request)

Do you want to map an object from the `Request`?

```
use Liuggio\Filler\HTTPPropertyTrait;

class StartShippingDTO
{
    use HTTPPropertyTrait;

    private $developer;

    public function __construct(Request $request)
    {
        $this->fillPropertiesFromRequest($request);
    }
...
}

Class Controller
{
    public function startShippingAction(Request $request)
    {
        $startShipping = new StartShippingDTO($request);

        if ($this->isValid($startShipping)) ...
    }
}
```

### Copy 2 objects

[](#copy-2-objects)

You can also use it for copy properties between 2 objects

```
use HTTPPropertyTrait;
$to = new DTOFromRequest();
$this->fillPropertiesFromRequest($request, $to);
// the $to object has all the var from the Request
```

Differences?
------------

[](#differences)

We needed it for an edge case, but then we have decided to release it because if you are used to develop with the `Command` pattern, this lib could help you to develop faster app.

More info at: [verraes:decoupling-symfony2-forms-from-entities](http://verraes.net/2013/04/decoupling-symfony2-forms-from-entities/)

Install
-------

[](#install)

`composer require liuggio/filler-dto dev-master`

API
---

[](#api)

```
trait PropertyTrait
   fillProperties($dto)
   getAllProperties($filter = null)

trait HTTPPropertyTrait
    fillPropertiesFromRequest(Request $request, $name = '')
    copyPropertiesFromRequest(Request $request, $to)

```

Example
-------

[](#example)

Please have a look to the tests and [tests/Fixtures](./tests) folders :)

Compatibility
-------------

[](#compatibility)

- > = 5.4
- hhvm

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity33

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 90.9% 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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3673d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/446a646f719434553ab25f0f931d28ec09fbb036528126ac7e9d54a2e8132581?d=identicon)[liuggio](/maintainers/liuggio)

---

Top Contributors

[![liuggio](https://avatars.githubusercontent.com/u/530406?v=4)](https://github.com/liuggio "liuggio (10 commits)")[![garak](https://avatars.githubusercontent.com/u/179866?v=4)](https://github.com/garak "garak (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/liuggio-filler-dto/health.svg)

```
[![Health](https://phpackages.com/badges/liuggio-filler-dto/health.svg)](https://phpackages.com/packages/liuggio-filler-dto)
```

###  Alternatives

[astrotomic/laravel-vcard

A fluent builder class for vCard files.

5330.0k](/packages/astrotomic-laravel-vcard)[digital-creative/icon-action-toolbar

Allows you to update a single column of a resource all at once.

2626.0k](/packages/digital-creative-icon-action-toolbar)[trive/module-revo

A Magento 2 module for managing product carousel

103.7k](/packages/trive-module-revo)

PHPackages © 2026

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