-
Notifications
You must be signed in to change notification settings - Fork 1
/
DoctrineOrmPhpcrAdapterBundle.php
33 lines (29 loc) · 1.15 KB
/
DoctrineOrmPhpcrAdapterBundle.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php
namespace Doctrine\ORM\Bundle\DoctrineOrmPhpcrAdapterBundle;
use Doctrine\ORM\Bundle\DoctrineOrmPhpcrAdapterBundle\DependencyInjection\Compiler\EventAdderCompilerPass;
use Symfony\Bridge\Doctrine\DependencyInjection\CompilerPass\RegisterEventListenersAndSubscribersPass;
use Symfony\Component\DependencyInjection\Compiler\PassConfig;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\Bundle;
/**
* Bundle Class for DoctrineOrmPhpcrAdapterBundle.
*
* @author Maximilian Berghoff <[email protected]>
*/
class DoctrineOrmPhpcrAdapterBundle extends Bundle
{
public function build(ContainerBuilder $container)
{
parent::build($container);
if (class_exists('Doctrine\ODM\PHPCR\Version')) {
$container->addCompilerPass(
new RegisterEventListenersAndSubscribersPass(
'doctrine_orm_phpcr_adapter.sessions',
'doctrine_orm_phpcr_adapter.adapter.%s_event_manager',
'doctrine_orm_phpcr_adapter'
),
PassConfig::TYPE_BEFORE_OPTIMIZATION
);
}
}
}