public function prepend(ContainerBuilder $container)
    {
        $bundles = $container->getParameter('kernel.bundles');

        if (isset($bundles['DoctrineBundle'])) {
            $mappingConfig = [
                'orm' => [
                    'entity_managers' => [
                        'default' => [
                            'mappings' => [
                                'HMLBDDDBundle' => [
                                    'mapping' => true,
                                    'type' => 'xml',
                                    'dir' => __DIR__.'/../Resources/config/doctrine',
                                    'prefix' => 'HMLB\DDD',
                                    'is_bundle' => false,
                                ],
                            ],
                        ],
                    ],
                ],
            ];

            $container->getExtension('doctrine');
            $container->prependExtensionConfig('doctrine', $mappingConfig);
        }

        $container->prependExtensionConfig(
            'command_bus',
            [
                'command_name_resolver_strategy' => 'named_message',
            ]
        );
        $container->prependExtensionConfig(
            'event_bus',
            [
                'event_name_resolver_strategy' => 'named_message',
            ]
        );
    }
public function prepend(ContainerBuilder $container)
    {
        $bundles = $container->getParameter('kernel.bundles');

        if (isset($bundles['DoctrineBundle'])) {
            $mappingConfig = [
                'orm' => [
                    'entity_managers' => [
                        'default' => [
                            'mappings' => [
                                'HMLBDDDBundle' => [
                                    'mapping' => true,
                                    'type' => 'xml',
                                    'dir' => __DIR__.'/../Resources/config/doctrine',
                                    'prefix' => 'HMLB\DDD',
                                    'is_bundle' => false,
                                ],
                            ],
                        ],
                    ],
                ],
            ];

            $container->getExtension('doctrine');
            $container->prependExtensionConfig('doctrine', $mappingConfig);
        }

        $container->prependExtensionConfig(
            'command_bus',
            [
                'command_name_resolver_strategy' => 'named_message',
            ]
        );
        $container->prependExtensionConfig(
            'event_bus',
            [
                'event_name_resolver_strategy' => 'named_message',
            ]
        );
    }
public function prepend ( ContainerBuilder $ container ) { $ bundles = $ container -> getParameter ( 'kernel.bundles' ) ; if ( isset ( $ bundles [ 'DoctrineBundle' ] ) ) { $ mappingConfig = [ 'orm' => [ 'entity_managers' => [ 'default' => [ 'mappings' => [ 'HMLBDDDBundle' => [ 'mapping' => true , 'type' => 'xml' , 'dir' => __DIR__ . '/../Resources/config/doctrine' , 'prefix' => 'HMLB\DDD' , 'is_bundle' => false , ] , ] , ] , ] , ] , ] ; $ container -> getExtension ( 'doctrine' ) ; $ container -> prependExtensionConfig ( 'doctrine' , $ mappingConfig ) ; } $ container -> prependExtensionConfig ( 'command_bus' , [ 'command_name_resolver_strategy' => 'named_message' , ] ) ; $ container -> prependExtensionConfig ( 'event_bus' , [ 'event_name_resolver_strategy' => 'named_message' , ] ) ; }
We add mapping information for our Messages Classes.

todo: It should be dynamic for non default entity_manager name
We add mapping information for our Messages Classes .