private function addAliases(
        ContainerBuilder $container,
        EntityMapping $entityMapping
    ) {
        $entityMappingFilePath = $entityMapping->getEntityMappingFilePath();
        if (strpos($entityMappingFilePath, '@') === 0) {
            $bundleName = trim(explode('/', $entityMappingFilePath, 2)[0]);
            $className = explode('\\', $entityMapping->getEntityNamespace());
            unset($className[count($className) - 1]);
            $configurationServiceDefinition = $container
                ->getDefinition(
                    'doctrine.orm.' . $entityMapping->getEntityManagerName() . '_configuration'
                );

            $configurationServiceDefinition->addMethodCall('addEntityNamespace', [
                $bundleName,
                implode('\\', $className),
            ]);
        }
    }
private function addAliases(
        ContainerBuilder $container,
        EntityMapping $entityMapping
    ) {
        $entityMappingFilePath = $entityMapping->getEntityMappingFilePath();
        if (strpos($entityMappingFilePath, '@') === 0) {
            $bundleName = trim(explode('/', $entityMappingFilePath, 2)[0]);
            $className = explode('\\', $entityMapping->getEntityNamespace());
            unset($className[count($className) - 1]);
            $configurationServiceDefinition = $container
                ->getDefinition(
                    'doctrine.orm.' . $entityMapping->getEntityManagerName() . '_configuration'
                );

            $configurationServiceDefinition->addMethodCall('addEntityNamespace', [
                $bundleName,
                implode('\\', $className),
            ]);
        }
    }
private function addAliases ( ContainerBuilder $ container , EntityMapping $ entityMapping ) { $ entityMappingFilePath = $ entityMapping -> getEntityMappingFilePath ( ) ; if ( strpos ( $ entityMappingFilePath , '@' ) === 0 ) { $ bundleName = trim ( explode ( '/' , $ entityMappingFilePath , 2 ) [ 0 ] ) ; $ className = explode ( '\\' , $ entityMapping -> getEntityNamespace ( ) ) ; unset ( $ className [ count ( $ className ) - 1 ] ) ; $ configurationServiceDefinition = $ container -> getDefinition ( 'doctrine.orm.' . $ entityMapping -> getEntityManagerName ( ) . '_configuration' ) ; $ configurationServiceDefinition -> addMethodCall ( 'addEntityNamespace' , [ $ bundleName , implode ( '\\' , $ className ) , ] ) ; } }
Add aliases for short Doctrine accessing mode.

This method will make a vitual association between the bundle proposing
the entity and the entity namespace, even if both elements are in
different packages (Bundle + Component).

Only useful and working when the relation between a bundle and the entity
folder path [[ Bundle (*) => (1) Entity path ]]

@param ContainerBuilder $container
@param EntityMapping    $entityMapping
Add aliases for short Doctrine accessing mode .