• Stars
    star
    117
  • Rank 301,828 (Top 6 %)
  • Language
    PHP
  • License
    MIT License
  • Created almost 13 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A data-marshaling toolset

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

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

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.

Alternatively, download a release or clone this repository, then require or include its autoload.php file.

Quality

Scrutinizer Code Quality codecov Continuous Integration

To run the unit tests at the command line, issue composer install and then ./vendor/bin/phpunit at the package root. This requires Composer to be available as composer.

This library attempts to comply with PSR-1, PSR-2, and PSR-4. If you notice compliance oversights, please send a patch via pull request.

Community

To ask questions, provide feedback, or otherwise communicate with the Aura community, please join our Google Group, follow @auraphp on Twitter, or chat with us on #auraphp on Freenode.

Overview

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

... 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

This package is fully documented here.

More Repositories

1

Aura.Sql

SQL database access through PDO.
PHP
549
star
2

Aura.Router

A web router implementation for PHP.
PHP
491
star
3

Aura.SqlQuery

Independent query builders for MySQL, PostgreSQL, SQLite, and Microsoft SQL Server.
PHP
445
star
4

Aura.Di

Dependency Injection System
PHP
347
star
5

Aura.Session

Tools for managing sessions, including session segments and read-once messages
PHP
201
star
6

Aura.Filter

Validate and sanitize arrays and objects.
PHP
159
star
7

Aura.Auth

Provides a unified interface to local and remote authentication systems.
PHP
134
star
8

Aura.Cli

Command-Line Interface tools
PHP
104
star
9

Aura.Framework

Composes the various aura v1 packages into v1 framework.
PHP
100
star
10

Aura.Autoload

A PSR-0 compliant autoloader
PHP
96
star
11

Aura.Intl

Internationalization tools, particularly message translation.
PHP
90
star
12

Aura.View

Provides TemplateView and TwoStepView using PHP as the templating language, with support for partials, sections, and helpers.
PHP
86
star
13

Aura.Web

Web controllers and support classes
PHP
82
star
14

Aura.Http

HTTP Request and Response tools
PHP
72
star
15

Aura.Input

Tools to describe HTML form fields and values.
PHP
65
star
16

system

A full-stack framework built from Aura library packages.
PHP
63
star
17

Aura.Web_Project

A web framework project skeleton.
PHP
61
star
18

Aura.Payload

A Domain Payload implementation.
PHP
55
star
19

Aura.Html

Provides HTML escapers and helpers, including form input helpers.
PHP
52
star
20

Aura.SqlSchema

Independent schema discovery tools for MySQL, PostgreSQL, SQLite, and Microsoft SQL Server.
PHP
41
star
21

Aura.Dispatcher

Object factory and method invoker.
PHP
38
star
22

Aura.Accept

Provides content-negotiation tools using Accept* headers.
PHP
36
star
23

Aura.Signal

SignalSlots / EventHandler Implementation
PHP
33
star
24

Aura.Framework_Project

A minimal web+CLI framework built from Aura v2 components.
PHP
29
star
25

auraphp.github.io

Static pages for github site
HTML
27
star
26

Aura.Web_Kernel

The kernel files for a web project.
PHP
25
star
27

Aura.Uri

Tools to build and modify URLs.
PHP
24
star
28

Aura.SqlMapper_Bundle

A DataMapper and UnitOfWork implementation.
PHP
16
star
29

Aura.Cli_Project

The skeleton for a CLI project.
PHP
14
star
30

Aura.Includer

Include multiple files from specified directories, in order, with variables injected into a limited include scope.
PHP
14
star
31

Aura.Payload_Interface

An interface package for Domain Payload implementations.
PHP
13
star
32

Aura.Project_Kernel

A generic project kernel.
PHP
9
star
33

Aura.Cli_Kernel

The kernel files for a CLI project.
PHP
6
star
34

Aura.Framework_Demo

"Hello World" demos for Aura version 1 framework
PHP
6
star
35

Aura.Filter_Interface

Interface for Filter objects.
PHP
5
star
36

bin

Unix CLI tools for Aura project management
PHP
5
star
37

installer-system

Composer installer for Aura systems.
PHP
3
star
38

installer-default

Composer installer for default Composer setups.
PHP
3
star
39

Example.Testing

An example package for release testing
PHP
2
star