---
title: "Symfony Integration"
description: "Wire the entity manager and the repository factory with Symfony DependencyInjection"
type: "docs"
category: "doc"
tags: []
authors: [Anonymous]
date: "2026-10-26"
last_update: "2026-10-26"
time_minutes: 1
draft: false
unlisted: false
url: "https://www.derafu.dev/docs/data/orm/symfony"
---

# Symfony Integration

For an application that uses `symfony/dependency-injection`, `resources/config/orm-services.yaml` defines these services:

| Service | Notes |
|---------|-------|
| `EntityManagerFactory` and `ConnectionParametersFactory` | With their contracts, `EntityManagerFactoryInterface` and `ConnectionParametersFactoryInterface`, as aliases. An application replaces a factory by pointing the alias to its own service |
| `Doctrine\ORM\EntityManagerInterface` | Created by the factory of the entity manager, from the parameters `doctrine.dbal` and `doctrine.orm` |
| `DoctrineRepositoryFactory` | To register in the repository manager, see [repositories](https://www.derafu.dev/docs/data/orm/repositories) |
| The provider of the translations of the package | Tagged `derafu_translation.resource_provider` |

Import it from the file of services of the application and set the parameters:

```yaml
imports:
    - { resource: '../vendor/derafu/orm/resources/config/orm-services.yaml' }

parameters:
    doctrine.dbal:
        url: '%env(DATABASE_URL)%'
    doctrine.orm:
        paths: ['%kernel.project_dir%/src/Entity']
        naming_strategy: Doctrine\ORM\Mapping\UnderscoreNamingStrategy
```

Their defaults are a SQLite file in `var/app.db` and the entities in `src/Entity`. An application can ignore the file and define its own services, with its own configuration or with Doctrine directly.



---
Last updated on 26/10/2026

