PHPackages                             aura/marshal - 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. aura/marshal

ActiveAura-package

aura/marshal
============

The Aura Marshal package is a data-object marshalling tool; it takes results from data sources and marshals those result sets into domain model objects of your own design, preserving data relationships along the way.

4.0.4(5mo ago)114141.9k↓22.2%192MITPHPPHP ^7.2 || ^8.0CI passing

Since Nov 28Pushed 5mo ago13 watchersCompare

[ Source](https://github.com/auraphp/Aura.Marshal)[ Packagist](https://packagist.org/packages/aura/marshal)[ Docs](http://auraphp.github.com/Aura.Marshal)[ RSS](/packages/aura-marshal/feed)WikiDiscussions 4.x Synced 1mo ago

READMEChangelog (7)Dependencies (2)Versions (14)Used By (2)

Aura Marshal
============

[](#aura-marshal)

> marshal (verb): to arrange in proper order; set out in an orderly manner; arrange clearly: to marshal facts; to marshal one's arguments. -- [dictionary.com](http://dictionary.reference.com/browse/marshal)

The Aura Marshal package is a data-object marshalling tool. It takes results from data sources and marshals those result sets into domain model objects of your own design, preserving data relationships along the way.

Foreword
--------

[](#foreword)

### Installation

[](#installation)

This library requires PHP 7.2 or later; we recommend using the latest available version of PHP as a matter of principle. It has no userland dependencies.

It is installable and autoloadable via Composer as [aura/marshal](https://packagist.org/packages/aura/marshal).

Alternatively, [download a release](https://github.com/auraphp/Aura.Marshal/releases) or clone this repository, then require or include its *autoload.php* file.

### Quality

[](#quality)

[![Scrutinizer Code Quality](https://camo.githubusercontent.com/e77d2da9dd527fbbb0da7e15af6c13f6e4877c5d5b7e6d19c2941b21d46fc3a2/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f617572617068702f417572612e4d61727368616c2f6261646765732f7175616c6974792d73636f72652e706e673f623d342e78)](https://scrutinizer-ci.com/g/auraphp/Aura.Marshal/)[![codecov](https://camo.githubusercontent.com/6979886f2a0a72fa470dceb5eaab9d0481d486dd8f25b791ec5917f59186ab27/68747470733a2f2f636f6465636f762e696f2f67682f617572617068702f417572612e4d61727368616c2f6272616e63682f342e782f67726170682f62616467652e7376673f746f6b656e3d554153446f754c787963)](https://codecov.io/gh/auraphp/Aura.Marshal)[![Continuous Integration](https://github.com/auraphp/Aura.Marshal/actions/workflows/continuous-integration.yml/badge.svg?branch=4.x)](https://github.com/auraphp/Aura.Marshal/actions/workflows/continuous-integration.yml)

To run the unit tests at the command line, issue `composer install` and then `./vendor/bin/phpunit` at the package root. This requires [Composer](http://getcomposer.org/) to be available as `composer`.

This library attempts to comply with [PSR-1](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-1-basic-coding-standard.md), [PSR-2](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md), and [PSR-4](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-4-autoloader.md). If you notice compliance oversights, please send a patch via pull request.

### Community

[](#community)

To ask questions, provide feedback, or otherwise communicate with the Aura community, please join our [Google Group](http://groups.google.com/group/auraphp), follow [@auraphp on Twitter](http://twitter.com/auraphp), or chat with us on #auraphp on Freenode.

Overview
--------

[](#overview)

You can use any database access layer you like with Aura Marshal, such as ...

- [`mysql`](http://php.net/mysql) or the other PHP database function sets
- [`PDO`](http://php.net/PDO)
- [`Aura SQL`](https://github.com/auraphp/Aura.Sql)
- [`Solar_Sql_Adapter`](http://solarphp.com/class/Solar_Sql_Adapter)
- [`Zend_Db_Adapter`](http://framework.zend.com/manual/en/zend.db.adapter.html)
- [`Doctrine2 DBAL`](http://www.doctrine-project.org/docs/dbal/2.1/en)

... or anything else. (In theory, you should be able to retrieve data from XML, CSV, Mongo, or anything else, and load it into Aura Marshal.)

With Aura Marshal, you use the data retrieval tools of your choice and write your own queries to retrieve data from a data source. You then load that result data into an entity type object, and it creates entity and collection objects for you based on a mapping scheme you define for it.

Aura Marshal makes it easy to avoid the N+1 problem when working with a domain model. It also uses an identity map (per type) to avoid retaining multiple copies of the same object.

It is important to remember that Aura Marshal, despite resembling an ORM in many ways, it *not* an ORM proper:

- it does not have a query-building facility
- it will not issue queries on its own
- it will not handle persistence for you
- it will not lazy-load results from a data source
- it will not read metadata or schemas from the datasource

Those things are outside the scope of the Aura Marshal package. Their absence does provide a great amount of flexibility for power users who write their own hand-tuned SQL and need a way to marshal their result sets into a domain model, especially in legacy codebases.

Aura Marshal works by using `Type` objects (which define the entity types in the domain model). Each `Type` has a definition indicating its identity field, how to build entities and collections, and the relationships to other `Type`objects. The `Type` objects are accessed through a type `Manager`. You load data into each `Type` in the `Manager`, then you retrieve entities and collections from each `Type`.

Documentation
-------------

[](#documentation)

This package is fully documented [here](./docs/index.md).

###  Health Score

58

—

FairBetter than 98% of packages

Maintenance70

Regular maintenance activity

Popularity47

Moderate usage in the ecosystem

Community27

Small or concentrated contributor base

Maturity75

Established project with proven stability

 Bus Factor1

Top contributor holds 67.2% 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 ~365 days

Recently: every ~297 days

Total

14

Last Release

174d ago

Major Versions

1.x-dev → 4.0.02022-08-03

PHP version history (2 changes)1.0.0PHP &gt;=5.4.0

4.0.0PHP ^7.2 || ^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/25754?v=4)[Paul M. Jones](/maintainers/pmjones)[@pmjones](https://github.com/pmjones)

![](https://www.gravatar.com/avatar/29dba0e6add8d89fd3fc6126b213d5d2f57538ea78318963025d6ea98db34161?d=identicon)[harikt](/maintainers/harikt)

---

Top Contributors

[![harikt](https://avatars.githubusercontent.com/u/120454?v=4)](https://github.com/harikt "harikt (39 commits)")[![koriym](https://avatars.githubusercontent.com/u/529021?v=4)](https://github.com/koriym "koriym (6 commits)")[![compwright](https://avatars.githubusercontent.com/u/138688?v=4)](https://github.com/compwright "compwright (6 commits)")[![sobstel](https://avatars.githubusercontent.com/u/117428?v=4)](https://github.com/sobstel "sobstel (4 commits)")[![yutakachiba](https://avatars.githubusercontent.com/u/5999747?v=4)](https://github.com/yutakachiba "yutakachiba (1 commits)")[![pborreli](https://avatars.githubusercontent.com/u/77759?v=4)](https://github.com/pborreli "pborreli (1 commits)")[![jakefolio](https://avatars.githubusercontent.com/u/199860?v=4)](https://github.com/jakefolio "jakefolio (1 commits)")

---

Tags

api-sourceaura-marshalbuildercsv-sourcedb-sourceentityentity-objectsphpretrieve-datastandalone-php-librarydatadata mapperdata objectdata marshaldata marshalling

###  Code Quality

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/aura-marshal/health.svg)

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

###  Alternatives

[fakerphp/faker

Faker is a PHP library that generates fake data for you.

4.0k358.5M3.5k](/packages/fakerphp-faker)[nelmio/alice

Expressive fixtures generator

2.5k43.4M133](/packages/nelmio-alice)[dflydev/dot-access-data

Given a deep data structure, access data by dot notation.

720359.1M86](/packages/dflydev-dot-access-data)[doctrine/mongodb-odm

PHP Doctrine MongoDB Object Document Mapper (ODM) provides transparent persistence for PHP objects to MongoDB.

1.1k23.3M302](/packages/doctrine-mongodb-odm)[theofidry/alice-data-fixtures

Nelmio alice extension to persist the loaded fixtures.

32328.5M70](/packages/theofidry-alice-data-fixtures)[rbone/phactory

A PHP library for generating data for tests

1157.5k](/packages/rbone-phactory)

PHPackages © 2026

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