class Registry extends ManagerRegistry implements RegistryInterface (View source)

References all Doctrine connections and entity managers in a given Container.

Methods

__construct(ContainerInterface $container, array $connections, array $entityManagers, $defaultConnection, $defaultEntityManager)

Construct.

string
getDefaultEntityManagerName() deprecated

Gets the default entity manager name.

EntityManager
getEntityManager(string $name = null) deprecated

Gets a named entity manager.

EntityManager[]
getEntityManagers() deprecated

Gets an array of all registered entity managers

resetEntityManager(string $name = null) deprecated

Resets a named entity manager.

string
getEntityNamespace(string $alias) deprecated

Resolves a registered namespace alias to the full namespace.

string
getAliasNamespace(string $alias)

Resolves a registered namespace alias to the full namespace.

string[]
getEntityManagerNames() deprecated

Gets all connection names.

EntityManager|null
getEntityManagerForClass(string $class) deprecated

Gets the entity manager associated with a given class.

Details

__construct(ContainerInterface $container, array $connections, array $entityManagers, $defaultConnection, $defaultEntityManager)

Construct.

Parameters

ContainerInterface $container
array $connections
array $entityManagers
$defaultConnection
$defaultEntityManager

string getDefaultEntityManagerName() deprecated

deprecated

Gets the default entity manager name.

Return Value

string The default entity manager name

EntityManager getEntityManager(string $name = null) deprecated

deprecated

Gets a named entity manager.

Parameters

string $name The entity manager name (null for the default one)

Return Value

EntityManager

EntityManager[] getEntityManagers() deprecated

deprecated

Gets an array of all registered entity managers

Return Value

EntityManager[] an array of all EntityManager instances

resetEntityManager(string $name = null) deprecated

deprecated

Resets a named entity manager.

This method is useful when an entity manager has been closed because of a rollbacked transaction AND when you think that it makes sense to get a new one to replace the closed one.

Be warned that you will get a brand new entity manager as the existing one is not usable anymore. This means that any other object with a dependency on this entity manager will hold an obsolete reference. You can inject the registry instead to avoid this problem.

Parameters

string $name The entity manager name (null for the default one)

string getEntityNamespace(string $alias) deprecated

deprecated

Resolves a registered namespace alias to the full namespace.

This method looks for the alias in all registered entity managers.

Parameters

string $alias The alias

Return Value

string The full namespace

string getAliasNamespace(string $alias)

Resolves a registered namespace alias to the full namespace.

This method looks for the alias in all registered entity managers.

Parameters

string $alias The alias

Return Value

string The full namespace

See also

Configuration::getEntityNamespace

string[] getEntityManagerNames() deprecated

deprecated

Gets all connection names.

Return Value

string[] An array of connection names

EntityManager|null getEntityManagerForClass(string $class) deprecated

deprecated

Gets the entity manager associated with a given class.

Parameters

string $class A Doctrine Entity class name

Return Value

EntityManager|null