protected function addEntityMapping(
        ContainerBuilder $container,
        $entityManagerName,
        $entityNamespace,
        $entityMappingFilePath,
        $enable = true
    ) : self {
        $entityMapping = $this->resolveEntityMapping(
            $container,
            $entityManagerName,
            $entityNamespace,
            $entityMappingFilePath,
            $enable
        );

        if ($entityMapping instanceof EntityMapping) {
            $this->registerLocatorConfigurator($container);
            $this->registerLocator($container, $entityMapping);
            $this->registerDriver($container, $entityMapping);
            $this->addDriverInDriverChain($container, $entityMapping);
            $this->addAliases($container, $entityMapping);
        }

        return $this;
    }
protected function addEntityMapping(
        ContainerBuilder $container,
        $entityManagerName,
        $entityNamespace,
        $entityMappingFilePath,
        $enable = true
    ) : self {
        $entityMapping = $this->resolveEntityMapping(
            $container,
            $entityManagerName,
            $entityNamespace,
            $entityMappingFilePath,
            $enable
        );

        if ($entityMapping instanceof EntityMapping) {
            $this->registerLocatorConfigurator($container);
            $this->registerLocator($container, $entityMapping);
            $this->registerDriver($container, $entityMapping);
            $this->addDriverInDriverChain($container, $entityMapping);
            $this->addAliases($container, $entityMapping);
        }

        return $this;
    }
protected function addEntityMapping ( ContainerBuilder $ container , $ entityManagerName , $ entityNamespace , $ entityMappingFilePath , $ enable = true ) : self { $ entityMapping = $ this -> resolveEntityMapping ( $ container , $ entityManagerName , $ entityNamespace , $ entityMappingFilePath , $ enable ) ; if ( $ entityMapping instanceof EntityMapping ) { $ this -> registerLocatorConfigurator ( $ container ) ; $ this -> registerLocator ( $ container , $ entityMapping ) ; $ this -> registerDriver ( $ container , $ entityMapping ) ; $ this -> addDriverInDriverChain ( $ container , $ entityMapping ) ; $ this -> addAliases ( $ container , $ entityMapping ) ; } return $ this ; }
Add mapping entity.

This method adds a new Driver into global MappingDriverChain with single
entity mapping information.

$entityManagerName must be an existing entityManager. By default doctrine
creates just one common EntityManager called default, but many can be
defined with different connection information

p.e. default
p.e. anotherEntityManager

$entityNamespace must be an existing namespace of Entity. This value also
can be a valid and existing container parameter, with an existing
namespace of Entity as value.

p.e. MyBundle\Entity\User
p.e. mybundle.entity.user.class

$entityMappingFilePath must be a path of an existing yml or xml file with
mapping information about $entityNamespace. This bundle uses Short Bundle
notation, with "@" symbol. This value also can be a valid and existing
container parameter, with a path of an existing yml or xml file as value.

p.e. @MyBundle/Resources/config/doctrine/User.orm.yml
p.e. @MyBundle/Resources/config/doctrine/User.orm.xml
p.e. mybundle.entity.user.mapping_file_path

Finally, $enable flag just allow you to add current mapping definition
into all Doctrine Map table, or just dismiss it. This is useful when you
want to give possibility to final user to enable or disable a mapping
class.

@param ContainerBuilder $container             Container
@param string           $entityManagerName     EntityManager name
@param string           $entityNamespace       Entity namespace
@param string           $entityMappingFilePath Entity Mapping file path
@param bool|string      $enable                Entity mapping must be included

@return AbstractMappingCompilerPass

@throws EntityManagerNotFoundException Entity Manager nod found
Add mapping entity .