1.2.1. Getting Started Installation

This package is installable and autoloadable via Composer as atlas/orm. Add the following lines to your composer.json file, then call composer update.

    "require": {
        "atlas/orm": "~1.0"
    "require-dev": {
        "atlas/cli": "~1.0"

(The atlas/cli package provides the atlas-skeleton command-line tool to help create skeleton classes for the mapper.) Creating Data Source Classes

You can create your data source classes by hand, but it's going to be tedious to do so. Instead, use the atlas-skeleton command to read the table information from the database. You can read more about that in the atlas/cli docs. Instantiating Atlas

Create an Atlas instance using the AtlasContainer.

The container accepts a PDO, ExtendedPdo or ConnectionLocator instance or you can enter connection parameters and the container creates a connection for you.

$atlasContainer = new AtlasContainer(new PDO(...));
// or
$atlasContainer = new AtlasContainer(new ExtendedPdo(...));
// or
$atlasContainer = new AtlasContainer(new ConnectionLocator(...));
// or
$atlasContainer = new AtlasContainer(

Next, set the available mapper classes into the container.


Finally, get back the Atlas instance out of the container.

$atlas = $atlasContainer->getAtlas();