PHPackages                             didix16/php-hydrator - 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. didix16/php-hydrator

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

didix16/php-hydrator
====================

A simple library that uses the hydration pattern to fill objects given different sources of data.

v1.0.1(4y ago)09.0k1MITPHPPHP &gt;= 7.2

Since Aug 6Pushed 4y ago1 watchersCompare

[ Source](https://github.com/didix16/php-hydrator)[ Packagist](https://packagist.org/packages/didix16/php-hydrator)[ RSS](/packages/didix16-php-hydrator/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependenciesVersions (3)Used By (1)

PHP Hydrator
============

[](#php-hydrator)

A simple library that uses the hydration pattern to fill objects given different sources of data.

Content
-------

[](#content)

- [What is Data Hydration](#what-is-data-hydration)
- [Installation](#installation)
- [Usage](#usage)
- [TODO](#todo)

### What is Data Hydration

[](#what-is-data-hydration)

Data hydration is the import of data into an object. When an object is waiting for data to fill it, this object is waiting to be hydrated. The source of that hydration can be a data lake or other data source. There are a number of data hydration methods to properly select and fill objects with the appropriate data

### Installation

[](#installation)

```
composer require didix16/php-hydrator
```

### Usage

[](#usage)

```
class MyModel  {

    private $property1;

    private $property2;

    ...
}

// this is an hydrator based on PHP reflection
$hydrator = new ReflectionHydrator();
$model = new MyModel();

$hydrator->hydrate([
    'property1' => 'value1',
    'propery2' => 'value2'
], $model);

//$model->getProperty1() === 'value1'
//$model->getProperty2() === 'value2'

$data = $hydrator->extract($model);

// data = ['property1' => 'value1', 'property2' => 'value2']
```

```
class MyModel implements  \ArrayAccess {

    protected $property1;

    protected $property2;

    // Implementation of ArrayAccess interface methods
    ...
}

// this is an hydrator based on object array serialization
$hydrator = new ArraySerializableHydrator();

$model = new MyModel();

$hydrator->hydrate([
    'property1' => 'value1',
    'propery2' => 'value2'
], $model);

//$model->getProperty1() === 'value1'
//$model->getProperty2() === 'value2'

$data = $hydrator->extract($model);

// data = ['property1' => 'value1', 'property2' => 'value2']
```

TODO
====

[](#todo)

Implement ObjectPropertyHydrator

Implement ClassMethodsHydrator

For more info check:

- [http://www.webconsults.eu/blog/entry/108-What\_is\_a\_Hydrator\_in\_Zend\_Framework\_2](http://www.webconsults.eu/blog/entry/108-What_is_a_Hydrator_in_Zend_Framework_2)
-
- [https://docs.laminas.dev/laminas-hydrator/v3/quick-start/#base\_interfaces](https://docs.laminas.dev/laminas-hydrator/v3/quick-start/#base_interfaces)

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity47

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.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

1745d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ff5b3b9759afa8c62b1a7ef35d31a80fef6b9ba1413afecde0890b33f5db351d?d=identicon)[didix16](/maintainers/didix16)

---

Top Contributors

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

---

Tags

dataSimplehydratorextractorhydration

### Embed Badge

![Health badge](/badges/didix16-php-hydrator/health.svg)

```
[![Health](https://phpackages.com/badges/didix16-php-hydrator/health.svg)](https://phpackages.com/packages/didix16-php-hydrator)
```

###  Alternatives

[fakerphp/faker

Faker is a PHP library that generates fake data for you.

3.9k358.5M3.5k](/packages/fakerphp-faker)[simplesoftwareio/simple-qrcode

Simple QrCode is a QR code generator made for Laravel.

2.9k27.6M92](/packages/simplesoftwareio-simple-qrcode)[dflydev/dot-access-data

Given a deep data structure, access data by dot notation.

718359.1M86](/packages/dflydev-dot-access-data)[rinvex/countries

Rinvex Countries is a simple and lightweight package for retrieving country details with flexibility. A whole bunch of data including name, demonym, capital, iso codes, dialling codes, geo data, currencies, flags, emoji, and other attributes for all 250 countries worldwide at your fingertips.

1.7k7.4M48](/packages/rinvex-countries)[cuyz/valinor

Dependency free PHP library that helps to map any input into a strongly-typed structure.

1.5k9.2M108](/packages/cuyz-valinor)[mbezhanov/faker-provider-collection

A collection of custom providers for the Faker library

2138.6M24](/packages/mbezhanov-faker-provider-collection)

PHPackages © 2026

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