PHPackages                             atlas/symfony - 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. [Framework](/categories/framework)
4. /
5. atlas/symfony

ActiveSymfony-bundle[Framework](/categories/framework)

atlas/symfony
=============

Symfony 4 bundle for Atlas 3

1.2.0(7y ago)1018.2k↓50%3[1 PRs](https://github.com/atlasphp/Atlas.Symfony/pulls)MITPHP

Since Jul 26Pushed 5y ago2 watchersCompare

[ Source](https://github.com/atlasphp/Atlas.Symfony)[ Packagist](https://packagist.org/packages/atlas/symfony)[ RSS](/packages/atlas-symfony/feed)WikiDiscussions 1.x Synced 1mo ago

READMEChangelog (4)Dependencies (2)Versions (5)Used By (0)

Symfony 4 Bundle for Atlas 3
============================

[](#symfony-4-bundle-for-atlas-3)

This package makes the [Atlas](http://atlasphp.io) ORM and command-line tooling available as a bundle for Symfony 4 projects.

(Atlas is a data mapper for your persistence layer, not your domain layer.)

Installation and Configuration
------------------------------

[](#installation-and-configuration)

1. In your Symfony 4 project, enable contributor recipes:

    ```
    composer config extra.symfony.allow-contrib true

    ```
2. Require the `atlas/symfony` package; this will activate a Symfony Flex recipe as part of the installation:

    ```
    composer require atlas/symfony ~1.0

    ```
3. Edit these new `.env` variables to define your database connection:

    ```
    ATLAS_PDO_DSN=mysql:host=myhost;dbname=mydatabase
    ATLAS_PDO_USERNAME=myusername
    ATLAS_PDO_PASSWORD=mypassword

    ```

> **Note:**
>
> If you are using PHPStorm, you may wish to copy the IDE meta file to your project to get full autocompletion on Atlas classes:
>
> ```
> cp ./vendor/atlas/orm/resources/phpstorm.meta.php ./.phpstorm.meta.php
>
> ```

In the `atlas.yaml` config file, these settings are notable:

- `atlas.orm.atlas.log_queries`: set this to `true` to enable the web profiler data collector for query logging.
- `atlas.orm.atlas.transaction_class`: set this to one of the Atlas transaction strategy classes, such as `Atlas\\Orm\\Transaction\\AutoTransact`. For more information, see the [transactions documentation](http://atlasphp.io/cassini/orm/transactions.html#1-1-6-2).
- The `options` section under any connection configuration can be used to set PDO attributes through the [PDO constructor](https://secure.php.net/manual/en/pdo.construct.php). For example:

    ```
    dsn: '%env(resolve:ATLAS_PDO_DSN)%'
    username: '%env(resolve:ATLAS_PDO_USERNAME)%'
    password: '%env(resolve:ATLAS_PDO_PASSWORD)%'
    options:
        !php/const PDO::EMULATE_PREPARES: false
        !php/const PDO::ATTR_CASE: !php/const PDO::CASE_NATURAL
    ```

Getting Started
---------------

[](#getting-started)

### Generating Mappers

[](#generating-mappers)

Use the command-line tooling to create the skeleton files for all your database tables:

```
mkdir src/DataSource
php bin/console atlas:skeleton

```

The `config/packages/atlas.yaml` file specifies `App\DataSource\` as the namespace, and `src/DataSource/` as the directory. To change them, modify the `atlas.cli.config.input` values for `directory` and `namespace` as you see fit.

The database table names will be converted to singular for their relevant type names in PHP. If you want a different type names for certain tables, modify the `atlas.cli.transform` values in the `atlas.yaml` file to map a from table name to a type name.

As you make changes to the database, re-run the skeleton generator, and the relevant table files will be regenerated.

For more information, see .

### Using Atlas

[](#using-atlas)

Now that there are mappers for all the database tables, you can use the Symfony dependency injection system to autowire Atlas into your classes for you.

```
namespace App;

use Atlas\Orm\Atlas;
use App\DataSource\Thread\Thread
use App\DataSource\Thread\ThreadRecord;

class ApplicationService
{
    public function __construct(Atlas $atlas)
    {
        $this->atlas = $atlas;
    }

    public function fetchThreadById($thread_id) : ThreadRecord
    {
        return $this->atlas->fetchRecord(Thread::class, $thread_id);
    }
}
```

Full documentation for using Atlas is at :

- [Defining relationships between mappers](http://atlasphp.io/cassini/orm/relationships.html)
- [Fetching Records and RecordSets](http://atlasphp.io/cassini/orm/reading.html)
- Working with [Records](http://atlasphp.io/cassini/orm/records.html)and [RecordSets](http://atlasphp.io/cassini/orm/record-sets.html)
- [Managing transactions](http://atlasphp.io/cassini/orm/transactions.html)
- [Adding behaviors](http://atlasphp.io/cassini/orm/behavior.html)
- [Handling events](http://atlasphp.io/cassini/orm/events.html)
- [Direct lower-level queries](http://atlasphp.io/cassini/orm/direct.html)
- [Other topics](http://atlasphp.io/cassini/orm/other.html) such as custom mapper methods, single table inheritance, many-to-many relationships, and automated validation

Enjoy!

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity31

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity65

Established project with proven stability

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 ~4 days

Total

5

Last Release

2834d ago

### Community

Maintainers

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

### Embed Badge

![Health badge](/badges/atlas-symfony/health.svg)

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

###  Alternatives

[nolimits4web/swiper

Most modern mobile touch slider and framework with hardware accelerated transitions

41.8k177.2k1](/packages/nolimits4web-swiper)[laravel/dusk

Laravel Dusk provides simple end-to-end testing and browser automation.

1.9k36.7M259](/packages/laravel-dusk)[laravel/prompts

Add beautiful and user-friendly forms to your command-line applications.

712181.8M596](/packages/laravel-prompts)[cakephp/chronos

A simple API extension for DateTime.

1.4k47.7M121](/packages/cakephp-chronos)[laravel/pail

Easily delve into your Laravel application's log files directly from the command line.

91545.3M590](/packages/laravel-pail)[nette/bootstrap

🅱 Nette Bootstrap: the simple way to configure and bootstrap your Nette application.

68535.8M592](/packages/nette-bootstrap)

PHPackages © 2026

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