pmill/doctrine-array-hydrator
pmill/doctrine-array-hydrator provides a Doctrine hydrator that populates entities and embedded objects from plain arrays, including nested associations and collections. It is useful for fixtures, imports, and API payloads, simplifying conversion of array data into Doctrine entities.
Consider it when:
laravel-doctrine, or a legacy Symfony app) and the mapping need is array-in, entity-out.$entity->setFoo($data['foo']) across dozens of importers, and you value a small, auditable code surface over feature breadth.Look elsewhere when:
To executives: This is a small, MIT-licensed utility that removes repetitive plumbing from every "get data into the system" feature — imports, partner feeds, back-office bulk edits. It does not add licence cost or vendor lock-in, and it lets one well-tested mapping approach replace many hand-written importers, which shortens delivery on a recurring category of roadmap work. The trade-off is maturity: the project is effectively dormant, so we would own it. Recommendation is to adopt only where we already run Doctrine 2, pin the version, and budget a small amount of engineering time to vendor it internally — treat it as code we adopt, not a supplier we depend on.
To engineering: It hydrates Doctrine 2 entities from arrays via configurable field maps, including nested associations, so importers become data plus mapping rather than bespoke setter code. Constraints: Doctrine 2 only, last release January 2020, 35 stars, no active maintainer. Proposed usage is to vendor or fork it behind our own thin interface so callers never import the package directly, then swap the implementation later if Doctrine 3 migration or a maintained serializer becomes the better fit. If we are not already on Doctrine 2, we should not adopt it — we should use the framework serializer or a small internal mapper instead.
How can I help you explore Laravel packages today?