Doctrine ORM and domain eventsΒΆ

As described in the documentation of the SimpleBus/DoctrineORMBridge package library it provides:

When you enable the DoctrineORMBridgeBundle in your project, both features will be automatically registered as command bus middlewares:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            ...
            new SimpleBus\SymfonyBridge\DoctrineOrmBridgeBundle()
        )
        ...
    }
    ...
}

You can optionally configure which entity manager and connection should be used:

1
2
3
4
5
# in config.yml

doctrine_orm_bridge:
    entity_manager: default
    connection: default