class RegisterMappingsPass implements CompilerPassInterface

Base class for the doctrine bundles to provide a compiler pass class that helps to register doctrine mappings.

The compiler pass is meant to register the mappings with the metadata chain driver corresponding to one of the object managers.

For concrete implementations that are easy to use, see the RegisterXyMappingsPass classes in the DoctrineBundle resp. DoctrineMongodbBundle, DoctrineCouchdbBundle and DoctrinePhpcrBundle.

Methods

__construct(Definition|Reference $driver, array $namespaces, array $managerParameters, string $driverPattern, string|false $enabledParameter = false, string $configurationPattern = '', string $registerAliasMethodName = '', array $aliasMap = array())

Constructor.

process(ContainerBuilder $container)

Register mappings and alias with the metadata drivers.

Details

at line line 122
__construct(Definition|Reference $driver, array $namespaces, array $managerParameters, string $driverPattern, string|false $enabledParameter = false, string $configurationPattern = '', string $registerAliasMethodName = '', array $aliasMap = array())

Constructor.

The $managerParameters is an ordered list of container parameters that could provide the name of the manager to register these namespaces and alias on. The first non-empty name is used, the others skipped.

The $aliasMap parameter can be used to define bundle namespace shortcuts like the DoctrineBundle provides automatically for objects in the default Entity/Document folder.

Parameters

Definition|Reference $driver Driver DI definition or reference
array $namespaces List of namespaces handled by $driver
array $managerParameters List of container parameters that could hold the manager name.
string $driverPattern Pattern for the metadata driver service name
string|false $enabledParameter Service container parameter that must be present to enable the mapping. Set to false to not do any check, optional.
string $configurationPattern Pattern for the Configuration service name
string $registerAliasMethodName Name of Configuration class method to register alias.
array $aliasMap Map of alias to namespace

at line line 142
process(ContainerBuilder $container)

Register mappings and alias with the metadata drivers.

Parameters

ContainerBuilder $container