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