# \#laminas-hydrator

**URL:** https://discourse.laminas.dev/tag/laminas-hydrator/85.md

[Latest](https://discourse.laminas.dev/latest.md) · [Categories](https://discourse.laminas.dev/categories.md) · [Tags](https://discourse.laminas.dev/tags.md)

---

## [What's still needed for laminas-hydrator v5 release?](https://discourse.laminas.dev/t/whats-still-needed-for-laminas-hydrator-v5-release/4013)

<div class="topic-metadata">

**Author:** [@Miroslav\_Malac](https://discourse.laminas.dev/u/Miroslav_Malac)\
**Replies:** 3\
**Last updated:** [September 22, 2026, 8:44am UTC](https://discourse.laminas.dev/t/whats-still-needed-for-laminas-hydrator-v5-release/4013 "2026-09-22T08:44:27Z")

</div>

Hi everyone, I’ve been contributing to the \`5.0.x\` branch and would love to help more. Is there anything still missing or blocked before v5 can be released? Happy to help with whatever is needed. Thanks!

---

## [\[RFC\] ReflectionHydrator should recognize Property Hooks](https://discourse.laminas.dev/t/rfc-reflectionhydrator-should-recognize-property-hooks/3979)

<div class="topic-metadata">

**Author:** [@ezkimo](https://discourse.laminas.dev/u/ezkimo)\
**Replies:** 1\
**Last updated:** [December 31, 2025, 11:08am UTC](https://discourse.laminas.dev/t/rfc-reflectionhydrator-should-recognize-property-hooks/3979 "2025-12-31T11:08:17Z")

</div>

Good morning, During my free time between the holidays, I worked a little with Laminas Hydrator under PHP 8.5. I noticed that the ReflectionHydrator class does not take property hooks into account. Property hooks can b…

---

## [Laminas Fieldset Objet / DoctrineObject Hydator issue](https://discourse.laminas.dev/t/laminas-fieldset-objet-doctrineobject-hydator-issue/3945)

<div class="topic-metadata">

**Author:** [@mobius](https://discourse.laminas.dev/u/mobius)\
**Replies:** 1\
**Last updated:** [August 13, 2025, 2:31pm UTC](https://discourse.laminas.dev/t/laminas-fieldset-objet-doctrineobject-hydator-issue/3945 "2025-08-13T14:31:57Z")

</div>

I’m trying to migrate Laminas\\Db project to doctrine and I’ve reached a point where I want to join my forms to the entities. I followed the guide in ( A Complete Example using Laminas\\Form - Doctrine Doctrine Laminas Hyd…

---

## [Json:serialize should get DateTime object as string](https://discourse.laminas.dev/t/json-serialize-should-get-datetime-object-as-string/3660)

<div class="topic-metadata">

**Author:** [@modir](https://discourse.laminas.dev/u/modir)\
**Replies:** 5\
**Last updated:** [April 4, 2024, 2:27pm UTC](https://discourse.laminas.dev/t/json-serialize-should-get-datetime-object-as-string/3660 "2024-04-04T14:27:57Z")

</div>

I have here an object and one of its properties is a DateTime object. Now I want to use Json::serialize() to get the JSON representation of it. Is there a way to instruct Json::serialize() to get the DateTime object as a…

---

## [How to prepare data from SQL for nested hydrator strategy](https://discourse.laminas.dev/t/how-to-prepare-data-from-sql-for-nested-hydrator-strategy/3626)

<div class="topic-metadata">

**Author:** [@stark](https://discourse.laminas.dev/u/stark)\
**Replies:** 5\
**Last updated:** [March 16, 2024, 9:59pm UTC](https://discourse.laminas.dev/t/how-to-prepare-data-from-sql-for-nested-hydrator-strategy/3626 "2024-03-16T21:59:47Z")

</div>

Hey guys, let’s imagine we have a Mezzio based REST API app. The data are stored in MariaDB so when retrieving those from DB we get a flat array: Data from DB: \[ 'name', 'surname', 'sample\_1', 'sample\_2',…

---

## [Hydrating 3 levels deep Nested Objects](https://discourse.laminas.dev/t/hydrating-3-levels-deep-nested-objects/3375)

<div class="topic-metadata">

**Author:** [@ivaylosp](https://discourse.laminas.dev/u/ivaylosp)\
**Replies:** 10\
**Last updated:** [June 23, 2023, 10:00am UTC](https://discourse.laminas.dev/t/hydrating-3-levels-deep-nested-objects/3375 "2023-06-23T10:00:07Z")

</div>

I have the following array : Array ( \[a\] =\> test\_1 \[hydra\_b\] =\> Array ( \[a\] =\> test\_2 \[hydra\_c\] =\> Array ( \[a\] =\> test\_3 \[b…

---

## [Hydrator not passing instance to filters on extract](https://discourse.laminas.dev/t/hydrator-not-passing-instance-to-filters-on-extract/2849)

<div class="topic-metadata">

**Author:** [@brzuchal](https://discourse.laminas.dev/u/brzuchal)\
**Replies:** 3\
**Last updated:** [April 20, 2022, 6:20am UTC](https://discourse.laminas.dev/t/hydrator-not-passing-instance-to-filters-on-extract/2849 "2022-04-20T06:20:02Z")

</div>

Noticed that for most hydration implementations on the extract method the filtering happens only by property name or method name without passing an instance object, which in fact is a filter method optional second argume…

---

## [Hydrate array object property with multiple fields](https://discourse.laminas.dev/t/hydrate-array-object-property-with-multiple-fields/2344)

<div class="topic-metadata">

**Author:** [@MatteoF](https://discourse.laminas.dev/u/MatteoF)\
**Replies:** 0\
**Last updated:** [June 10, 2021, 10:42am UTC](https://discourse.laminas.dev/t/hydrate-array-object-property-with-multiple-fields/2344 "2021-06-10T10:42:21Z")

</div>

Hello! I’m struggling a bit to properly hydrate an object property ( $collaborators ) class MyObject { /\* .. normal fields successfully hydrated with ReflectionHydrator ..\*/ protected $collaborators; // The proper…

---

## [How to return Select query into object instead of array](https://discourse.laminas.dev/t/how-to-return-select-query-into-object-instead-of-array/2311)

<div class="topic-metadata">

**Author:** [@ebuddy](https://discourse.laminas.dev/u/ebuddy)\
**Replies:** 6\
**Last updated:** [May 25, 2021, 7:39am UTC](https://discourse.laminas.dev/t/how-to-return-select-query-into-object-instead-of-array/2311 "2021-05-25T07:39:28Z")

</div>

Hello, I have a select query with many joined table. I would like to return it into select object and to access in my view. I have already use Hydrator but I think it work “only” if my query is on an unique entity/tabl…

---

## [Error when creating service from Abstract factories in my projecr](https://discourse.laminas.dev/t/error-when-creating-service-from-abstract-factories-in-my-projecr/2295)

<div class="topic-metadata">

**Author:** [@ebuddy](https://discourse.laminas.dev/u/ebuddy)\
**Replies:** 1\
**Last updated:** [May 8, 2021, 10:14pm UTC](https://discourse.laminas.dev/t/error-when-creating-service-from-abstract-factories-in-my-projecr/2295 "2021-05-08T22:14:59Z")

</div>

Hello everyone. I’m trying to create service with factories. I have many entities and I do not want to create factory for each of them. So I create an abstract factory. But when I try to access to my mapper, I get this…

---

## [Laminas-hydrator - Typed property](https://discourse.laminas.dev/t/laminas-hydrator-typed-property/2245)

<div class="topic-metadata">

**Author:** [@odan](https://discourse.laminas.dev/u/odan)\
**Replies:** 5\
**Last updated:** [April 14, 2021, 10:45am UTC](https://discourse.laminas.dev/t/laminas-hydrator-typed-property/2245 "2021-04-14T10:45:32Z")

</div>

Hello! I try to transform a PDO or QueryBuilder result set into an DTO (object with typed properties). final class FooData { public ?int $id = null; // other properties... } Example usage: // Result set fro…

---

## [Best way to hydrate doctrine entity data into laminas form](https://discourse.laminas.dev/t/best-way-to-hydrate-doctrine-entity-data-into-laminas-form/2183)

<div class="topic-metadata">

**Author:** [@ezkimo](https://discourse.laminas.dev/u/ezkimo)\
**Replies:** 2\
**Last updated:** [March 16, 2021, 7:40pm UTC](https://discourse.laminas.dev/t/best-way-to-hydrate-doctrine-entity-data-into-laminas-form/2183 "2021-03-16T19:40:19Z")

</div>

Long story short … I use a very complex form with a hand full of fieldsets and form collections. This form uses the ClassMethodsHydrator to hydrate the complex form data into a value object. This value object is given t…

---

## [Hydrator - nullable collection strategy](https://discourse.laminas.dev/t/hydrator-nullable-collection-strategy/1932)

<div class="topic-metadata">

**Author:** [@xorock](https://discourse.laminas.dev/u/xorock)\
**Replies:** 3\
**Last updated:** [November 6, 2020, 9:09pm UTC](https://discourse.laminas.dev/t/hydrator-nullable-collection-strategy/1932 "2020-11-06T21:09:15Z")

</div>

CollectionStrategy requires that value being extracted is array or throws exception. What’s the best approach to allow nullable field? I have extended CollectionStartegy and return null when the value is null but maybe t…
