@@ 27-64 (lines=38) @@ | ||
24 | * |
|
25 | * @author Beñat Espiña <[email protected]> |
|
26 | */ |
|
27 | class SimpleBusDoctrineODMMongoDBBridgeExtension extends Extension implements PrependExtensionInterface, SimpleBusTaggerExtension |
|
28 | { |
|
29 | /** |
|
30 | * {@inheritdoc} |
|
31 | */ |
|
32 | public function load(array $configs, ContainerBuilder $container) |
|
33 | { |
|
34 | $loader = new YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config')); |
|
35 | ||
36 | $loader->load('doctrine_odm_mongodb.yml'); |
|
37 | } |
|
38 | ||
39 | /** |
|
40 | * {@inheritdoc} |
|
41 | */ |
|
42 | public function prepend(ContainerBuilder $container) |
|
43 | { |
|
44 | $configuration = new Configuration(); |
|
45 | $configs = $container->getExtensionConfig('ben_gor_user'); |
|
46 | $config = $this->processConfiguration($configuration, $configs); |
|
47 | ||
48 | $container->setParameter('bengor_user.config', $config); |
|
49 | } |
|
50 | ||
51 | /** |
|
52 | * {@inheritdoc} |
|
53 | */ |
|
54 | public function addMiddlewareTags(ContainerBuilder $container, $user) |
|
55 | { |
|
56 | $container->getDefinition( |
|
57 | 'bengor_user.simple_bus_bridge_bundle.doctrine_odm_mongodb_transactional_middleware' |
|
58 | )->addTag( |
|
59 | 'bengor_user_' . $user . '_command_bus_middleware', ['priority' => '0'] |
|
60 | ); |
|
61 | ||
62 | return $container; |
|
63 | } |
|
64 | } |
|
65 |
@@ 27-64 (lines=38) @@ | ||
24 | * |
|
25 | * @author Beñat Espiña <[email protected]> |
|
26 | */ |
|
27 | class SimpleBusDoctrineORMBridgeExtension extends Extension implements PrependExtensionInterface, SimpleBusTaggerExtension |
|
28 | { |
|
29 | /** |
|
30 | * {@inheritdoc} |
|
31 | */ |
|
32 | public function load(array $configs, ContainerBuilder $container) |
|
33 | { |
|
34 | $loader = new YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config')); |
|
35 | ||
36 | $loader->load('doctrine_orm.yml'); |
|
37 | } |
|
38 | ||
39 | /** |
|
40 | * {@inheritdoc} |
|
41 | */ |
|
42 | public function prepend(ContainerBuilder $container) |
|
43 | { |
|
44 | $configuration = new Configuration(); |
|
45 | $configs = $container->getExtensionConfig('ben_gor_user'); |
|
46 | $config = $this->processConfiguration($configuration, $configs); |
|
47 | ||
48 | $container->setParameter('bengor_user.config', $config); |
|
49 | } |
|
50 | ||
51 | /** |
|
52 | * {@inheritdoc} |
|
53 | */ |
|
54 | public function addMiddlewareTags(ContainerBuilder $container, $user) |
|
55 | { |
|
56 | $container->getDefinition( |
|
57 | 'bengor_user.simple_bus_bridge_bundle.doctrine_orm_transactional_middleware' |
|
58 | )->addTag( |
|
59 | 'bengor_user_' . $user . '_command_bus_middleware', ['priority' => '0'] |
|
60 | ); |
|
61 | ||
62 | return $container; |
|
63 | } |
|
64 | } |
|
65 |