PHPackages                             bit3/contao-doctrine-orm - 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. [Database &amp; ORM](/categories/database)
4. /
5. bit3/contao-doctrine-orm

Abandoned → [ContaoBlackForest/contao-doctrine-orm](/?search=ContaoBlackForest%2Fcontao-doctrine-orm)ArchivedContao-module[Database &amp; ORM](/categories/database)

bit3/contao-doctrine-orm
========================

Doctrine ORM for Contao CMS

2.3.2(10y ago)01.4kLGPL-3.0+PHPPHP &gt;=5.3

Since Dec 9Pushed 10y ago1 watchersCompare

[ Source](https://github.com/bit3archive/contao-doctrine-orm)[ Packagist](https://packagist.org/packages/bit3/contao-doctrine-orm)[ RSS](/packages/bit3-contao-doctrine-orm/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (12)Versions (17)Used By (0)

Doctrine ORM Bridge
===================

[](#doctrine-orm-bridge)

This extension provide [Doctrine ORM](http://www.doctrine-project.org) in the [Contao Open Source CMS](http://contao.org). It provide an entity manager via the service `$container['doctrine.orm.entityManager']`. To use the Doctrine Connection within the Contao Database Framework, use [bit3/contao-doctrine-dbal-driver](https://github.com/bit3/contao-doctrine-dbal-driver).

Entity mapping
--------------

[](#entity-mapping)

To register an entity table, add to your **config.php**:

```
$GLOBALS['DOCTRINE_ENTITIES'][] = 'orm_my_entity_type';
```

The table name will be converted to `MyEntityType`.

Custom Namespaces can be mapped by a *table name prefix* to *class namespace* map:

```
$GLOBALS['DOCTRINE_ENTITY_NAMESPACE_MAP']['orm_my_entity'] = 'My\Entity';
```

Now the table name will be converted to `My\Entity\Type`.

While `DOCTRINE_ENTITY_NAMESPACE_MAP` is used for table name transformation, the array `DOCTRINE_ENTITY_NAMESPACE_ALIAS` is used to define doctrine namespace aliases.

```
$GLOBALS['DOCTRINE_ENTITY_NAMESPACE_ALIAS']['My'] = 'My\Entity';
```

Now you can use `My:Type` instead of `My\Entity\Type` as entity name.

Configure entities via DCA
--------------------------

[](#configure-entities-via-dca)

```
