Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Doctrine Array Hydrator Laravel Package

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.

Deep Wiki
Context7

Product Decisions This Supports

  • Build vs. buy for data-ingestion features. Any roadmap item that pulls external data (CSV uploads, partner API payloads, webhook bodies, ERP exports) into the domain model needs an array/JSON → entity mapping layer. This package is a candidate "buy" (MIT, zero licence cost) versus writing and maintaining bespoke mappers per importer.
  • Import/admin tooling prioritisation. Bulk import, back-office data correction, and "upload a spreadsheet" workflows are recurring, low-glamour roadmap items. A reusable hydrator turns each one from a bespoke mini-project into a configuration exercise (field map + validation), which changes the cost estimate and therefore the sequencing of those items.
  • Standardising ingestion across services. If several teams hand-roll mapping code, the decision is whether to converge on one hydration convention (this package or an internal equivalent) to reduce divergent, untested mapping logic. This package is small enough to vendor/fork as that convention.
  • Architecture choice for DDD/CQRS-style codebases. Where commands and importers carry plain arrays rather than DTOs, a hydrator avoids leaking setter boilerplate into application services and keeps controllers thin. It supports the decision to keep transport-shaped data at the edges and entities inside.
  • De-risking vendor/maintenance choices. The package's age (last release Jan 2020) makes "adopt as-is" vs. "fork and own" vs. "use the framework's serializer" an explicit decision rather than an accident. That is a genuine PM-owned call about ongoing maintenance budget.
  • Test/seed and fixture strategy. Deterministic array→entity construction simplifies fixtures and demo-data generation, which supports decisions about how much to invest in test infrastructure versus manual QA.

When to Consider This Package

Consider it when:

  • You are already committed to Doctrine 2 entities (e.g. a Laravel app using laravel-doctrine, or a legacy Symfony app) and the mapping need is array-in, entity-out.
  • The workload is ingestion-shaped: imports, sync jobs, seeders, fixtures, webhook handlers, admin bulk edits — not general-purpose API serialisation.
  • You want declarative field maps rather than repeating $entity->setFoo($data['foo']) across dozens of importers, and you value a small, auditable code surface over feature breadth.
  • You need nested/associated entity hydration from nested arrays without standing up a full serializer stack.
  • You have the capacity to pin, vendor, or fork a low-traffic dependency (35 stars, no releases in ~5 years) and treat it as internal code if upstream goes quiet.

Look elsewhere when:

  • You are on Doctrine ORM 3+ or a greenfield project. Compatibility with modern Doctrine/PHP versions is unverified; assume you will be the maintainer.
  • You need bidirectional mapping, validation, serialisation groups, circular-reference handling, or API documentation integration — a maintained serializer (Symfony Serializer, JMS Serializer, API Platform) is the better buy despite the extra surface area.
  • Your requirement is really DTO/hydration for request payloads rather than Doctrine entities; a plain mapper or framework validator is simpler.
  • You cannot accept an unmaintained dependency (regulated environments, long-lived enterprise contracts, security review gates that flag dormant packages).
  • The mapping is one or two importers — the integration and learning cost likely exceeds just writing the setters.

How to Pitch It (Stakeholders)

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.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
uni-method/symfony-lib
tacticmedia/scim-server-bundle
neika-ai/symfony-bundle
mattleads/agent-publishing-bundle
glavweb/framework-bundle
glavweb/extra-bundle
glavweb/api-bundle
glavweb/admin-bundle
adachsoft/api-version-bundle
elsayed85/laravel-api-exceptions
ouhssini/laravel-demo-mode
daworks/ncloud-outbound-mailer-driver
gp247/cms
ignibyte/aic-gates
nexa-merchant/blog
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
cgv/localized-resource