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

Abandoned → [zendframework/zend-hydrator](/?search=zendframework%2Fzend-hydrator)ArchivedLibrary[Utility &amp; Helpers](/categories/utility)

odan/hydrator
=============

A high performance hydrator for PHP.

1.4.1(8y ago)519.1k2MITPHPPHP ^7.1

Since Oct 4Pushed 8y ago2 watchersCompare

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

READMEChangelog (7)Dependencies (1)Versions (9)Used By (0)

Hydrator
========

[](#hydrator)

A high performance hydrator for PHP.

[![Latest Version on Packagist](https://camo.githubusercontent.com/9190ef0020ebd46dc30ae393039a215ab5b5af9a09c2620ad9c822ab41b05484/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f6f64616e2f6879647261746f722e737667)](https://github.com/odan/hydrator/releases)[![Software License](https://camo.githubusercontent.com/074b89bca64d3edc93a1db6c7e3b1636b874540ba91d66367c0e5e354c56d0ea/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e737667)](LICENSE)[![Build Status](https://camo.githubusercontent.com/5f8ff5b5c6395f6609cb07682a4c514f4e536df34aed04ba9314f87417eef181/68747470733a2f2f7472617669732d63692e6f72672f6f64616e2f6879647261746f722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/odan/hydrator)[![Coverage Status](https://camo.githubusercontent.com/a9fb511233c3e669da0f2ead1220b6561fee06eaa06508c0c66093d248f815b9/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6f64616e2f6879647261746f722f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/odan/hydrator/code-structure)[![Quality Score](https://camo.githubusercontent.com/7e1f0ecc1fbf987453ffac80e1c763e9500b15e4050378096b83758bbef10393/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6f64616e2f6879647261746f722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/odan/hydrator/?branch=master)[![Total Downloads](https://camo.githubusercontent.com/a0578f224ee44005a5e84e284da8912c1526dad7c8655b2c1d486d6b386e66b1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6f64616e2f6879647261746f722e737667)](https://packagist.org/packages/odan/hydrator)

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

[](#requirements)

- PHP &gt;= 7.1

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

[](#installation)

```
composer require odan/hydrator
```

Features
--------

[](#features)

- Array to Object
- Object to Array

### ObjectProperty

[](#objectproperty)

Any data key matching a publicly accessible property will be hydrated; any public properties will be used for extraction.

### ClassMethod

[](#classmethod)

Any data key matching a setter method will be called in order to hydrate; any method matching a getter method will be called for extraction.

Usage
-----

[](#usage)

```
// User entity
class User
{
    public $id;
    public $username;
    public $firstName;
    public $email;
}

// A row from the database
$userRow = [
    'id' => 1,
    'username' => 'admin',
    'first_name' => 'John Doe',
    'email' => 'john@example.com'
];

// Create the hydrator
$hydrator = new \Odan\Hydrator\ObjectProperty();

// Convert array to a new User object (with lower camel case properties)
$user = $hydrator->hydrate($userRow, new User());

print_r($user);

/*
User Object
(
    [id] => 1
    [username] => admin
    [firstName] => John Doe
    [email] => john@example.com
)
*/

// Convert User object to an array with lower camel case keys
$array = $hydrator->extract($user);

print_r($array);

/*
Array
(
    [id] => 1
    [username] => admin
    [first_name] => John Doe
    [email] => john@example.com
)
*/
```

Alternatives
------------

[](#alternatives)

-
-
-

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity30

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

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

Every ~26 days

Recently: every ~39 days

Total

7

Last Release

2992d ago

Major Versions

0.1.0 → 1.0.02017-10-05

PHP version history (2 changes)1.1.0PHP ^7.0

1.2.0PHP ^7.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/89d408d7f6ed65cdbeba70a2da2d0a8a1135fc37ebc07c44989f509221cc91bd?d=identicon)[odan](/maintainers/odan)

---

Top Contributors

[![odan](https://avatars.githubusercontent.com/u/781074?v=4)](https://github.com/odan "odan (31 commits)")[![mstaack](https://avatars.githubusercontent.com/u/10169509?v=4)](https://github.com/mstaack "mstaack (1 commits)")

---

Tags

hydrationhydratorphparrayobjectentityhydratorhydrationpopopoco

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[symfony/property-access

Provides functions to read and write from/to an object or array using a simple string notation

2.8k295.3M2.5k](/packages/symfony-property-access)[cuyz/valinor

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

1.5k9.2M108](/packages/cuyz-valinor)[jasny/dotkey

Dot notation access for objects and arrays

14219.5k6](/packages/jasny-dotkey)[michaldudek/foundation

A set of useful PHP classes.

13111.9k13](/packages/michaldudek-foundation)[peridot-php/object-path

A string syntax to fetch values from array and object hierarchies

1053.6k1](/packages/peridot-php-object-path)

PHPackages © 2026

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