mediatekformation

RegistryInterface extends ManagerRegistry

References Doctrine connections and entity managers.

Tags
deprecated

since Symfony 4.4, use Doctrine\Persistence\ManagerRegistry instead

author

Fabien Potencier fabien@symfony.com

Table of Contents

getAliasNamespace()  : string
Resolves a registered namespace alias to the full namespace.
getConnection()  : object
Gets the named connection.
getConnectionNames()  : array<string|int, string>
Gets all connection names.
getConnections()  : array<string|int, object>
Gets an array of all registered connections.
getDefaultConnectionName()  : string
Gets the default connection name.
getDefaultEntityManagerName()  : string
Gets the default entity manager name.
getDefaultManagerName()  : string
Gets the default object manager name.
getEntityManager()  : EntityManager
Gets a named entity manager.
getEntityManagerForClass()  : EntityManager|null
Gets the entity manager associated with a given class.
getEntityManagerNames()  : array<string|int, mixed>
Gets all connection names.
getEntityManagers()  : array<string|int, mixed>
Gets an array of all registered entity managers.
getEntityNamespace()  : string
Resolves a registered namespace alias to the full namespace.
getManager()  : ObjectManager
Gets a named object manager.
getManagerForClass()  : ObjectManager|null
Gets the object manager associated with a given class.
getManagerNames()  : array<string|int, string>
Gets all object manager names.
getManagers()  : array<string|int, ObjectManager>
Gets an array of all registered object managers.
getRepository()  : ObjectRepository
Gets the ObjectRepository for a persistent object.
resetEntityManager()  : EntityManager
Resets a named entity manager.
resetManager()  : ObjectManager
Resets a named object manager.

Methods

getAliasNamespace()

Resolves a registered namespace alias to the full namespace.

public getAliasNamespace(string $alias) : string

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

Parameters
$alias : string

The alias.

Return values
string

The full namespace.

getConnection()

Gets the named connection.

public getConnection([string $name = null ]) : object
Parameters
$name : string = null

The connection name (null for the default one).

Return values
object

getConnectionNames()

Gets all connection names.

public getConnectionNames() : array<string|int, string>
Return values
array<string|int, string>

An array of connection names.

getConnections()

Gets an array of all registered connections.

public getConnections() : array<string|int, object>
Return values
array<string|int, object>

An array of Connection instances.

getDefaultConnectionName()

Gets the default connection name.

public getDefaultConnectionName() : string
Return values
string

The default connection name.

getDefaultEntityManagerName()

Gets the default entity manager name.

public getDefaultEntityManagerName() : string
Return values
string

The default entity manager name

getDefaultManagerName()

Gets the default object manager name.

public getDefaultManagerName() : string
Return values
string

The default object manager name.

getEntityManager()

Gets a named entity manager.

public getEntityManager([string $name = null ]) : EntityManager
Parameters
$name : string = null

The entity manager name (null for the default one)

Return values
EntityManager

getEntityManagerForClass()

Gets the entity manager associated with a given class.

public getEntityManagerForClass(string $class) : EntityManager|null
Parameters
$class : string

A Doctrine Entity class name

Return values
EntityManager|null

getEntityManagerNames()

Gets all connection names.

public getEntityManagerNames() : array<string|int, mixed>
Return values
array<string|int, mixed>

An array of connection names

getEntityManagers()

Gets an array of all registered entity managers.

public getEntityManagers() : array<string|int, mixed>
Return values
array<string|int, mixed>

An array of EntityManager instances

getEntityNamespace()

Resolves a registered namespace alias to the full namespace.

public getEntityNamespace(string $alias) : string

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

Parameters
$alias : string

The alias

Tags
see
Configuration::getEntityNamespace
Return values
string

The full namespace

getManager()

Gets a named object manager.

public getManager([string $name = null ]) : ObjectManager
Parameters
$name : string = null

The object manager name (null for the default one).

Return values
ObjectManager

getManagerForClass()

Gets the object manager associated with a given class.

public getManagerForClass(string $class) : ObjectManager|null
Parameters
$class : string

A persistent object class name.

Return values
ObjectManager|null

getManagerNames()

Gets all object manager names.

public getManagerNames() : array<string|int, string>
Return values
array<string|int, string>

An array of object manager names.

getManagers()

Gets an array of all registered object managers.

public getManagers() : array<string|int, ObjectManager>
Return values
array<string|int, ObjectManager>

An array of ObjectManager instances

getRepository()

Gets the ObjectRepository for a persistent object.

public getRepository(string $persistentObject[, string $persistentManagerName = null ]) : ObjectRepository
Parameters
$persistentObject : string

The name of the persistent object.

$persistentManagerName : string = null

The object manager name (null for the default one).

Tags
psalm-param

class-string<T> $persistentObject

psalm-return

ObjectRepository<T>

template

T

Return values
ObjectRepository

resetEntityManager()

Resets a named entity manager.

public resetEntityManager([string $name = null ]) : EntityManager

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
$name : string = null

The entity manager name (null for the default one)

Return values
EntityManager

resetManager()

Resets a named object manager.

public resetManager([string|null $name = null ]) : ObjectManager

This method is useful when an object 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 object manager as the existing one is not useable anymore. This means that any other object with a dependency on this object manager will hold an obsolete reference. You can inject the registry instead to avoid this problem.

Parameters
$name : string|null = null

The object manager name (null for the default one).

Return values
ObjectManager

Search results