PHPackages                             hiqdev/generated-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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. hiqdev/generated-hydrator

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

hiqdev/generated-hydrator
=========================

An Object Hydrator that allows very fast array to object to array conversion

4.6.0(2y ago)11181MITPHPPHP ~8.1.0 || ~8.2.0 || ~8.3.0

Since Jul 11Pushed 7mo agoCompare

[ Source](https://github.com/hiqdev/GeneratedHydrator)[ Packagist](https://packagist.org/packages/hiqdev/generated-hydrator)[ Docs](https://github.com/Ocramius/GeneratedHydrator)[ GitHub Sponsors](https://github.com/Ocramius)[ Fund](https://tidelift.com/funding/github/packagist/ocramius/generated-hydrator)[ RSS](/packages/hiqdev-generated-hydrator/feed)WikiDiscussions 4.7.x Synced 1mo ago

READMEChangelogDependencies (9)Versions (39)Used By (0)

Generated Hydrator
==================

[](#generated-hydrator)

GeneratedHydrator is a library about high performance transition of data from arrays to objects and from objects to arrays.

TestsReleasesDownloads[![Mutation testing badge](https://camo.githubusercontent.com/277174d0ace4ae54ef76062f3bc21ad6b571d52b13c59a8fdfaafd689d0deac6/68747470733a2f2f696d672e736869656c64732e696f2f656e64706f696e743f7374796c653d666c61742675726c3d687474707325334125324625324662616467652d6170692e737472796b65722d6d757461746f722e696f2532466769746875622e636f6d2532464f6372616d69757325324647656e6572617465644879647261746f722532466d6173746572)](https://dashboard.stryker-mutator.io/reports/github.com/Ocramius/GeneratedHydrator/master) [![Type Coverage](https://camo.githubusercontent.com/362d56718bf7d3f4423b2655926247bf0b83738b35cf4a6fbf6ebd4c5f1210b9/68747470733a2f2f73686570686572642e6465762f6769746875622f4f6372616d6975732f47656e6572617465644879647261746f722f636f7665726167652e737667)](https://shepherd.dev/github/Ocramius/GeneratedHydrator)[![Latest Stable Version](https://camo.githubusercontent.com/2d1fc42ba06183cbe04f94eda0fba9f773cdcee6c5f9e5fbda767ac296e70d97/68747470733a2f2f706f7365722e707567782e6f72672f6f6372616d6975732f67656e6572617465642d6879647261746f722f762f737461626c652e706e67)](https://packagist.org/packages/ocramius/generated-hydrator)[![Total Downloads](https://camo.githubusercontent.com/3ff66c8ef7967071e2a43f747108c2da56eb7ec138a5ba4322951f08c0f03086/68747470733a2f2f706f7365722e707567782e6f72672f6f6372616d6975732f67656e6572617465642d6879647261746f722f646f776e6c6f6164732e706e67)](https://packagist.org/packages/ocramius/generated-hydrator)What does this thing do?
------------------------

[](#what-does-this-thing-do)

A [hydrator](https://docs.laminas.dev/laminas-hydrator/v3/quick-start/) is an object capable of extracting data from other objects, or filling them with data.

A hydrator performs following operations:

- Convert `Object` to `array`
- Put data from an `array` into an `Object`

GeneratedHydrator uses proxying to instantiate very fast hydrators, since this will allow access to protected properties of the object to be handled by the hydrator.

Also, a hydrator of GeneratedHydrator implements `Laminas\Hydrator\HydratorInterface`.

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

[](#installation)

To install GeneratedHydrator, install [Composer](https://getcomposer.org/download/) and issue the following command:

```
composer require ocramius/generated-hydrator
```

Usage
-----

[](#usage)

Here's an example of how you can create and use a hydrator created by GeneratedHydrator:

```
