AbstractManagerRegistry
in package
implements
ManagerRegistry
Abstract implementation of the ManagerRegistry contract.
Table of Contents
Interfaces
- ManagerRegistry
- Contract covering object managers for a Doctrine persistence layer ManagerRegistry class to implement.
Properties
- $connections : array<string, string>
- $defaultConnection : string
- $defaultManager : string
- $managers : array<string, string>
- $name : string
- $proxyInterfaceName : string
Methods
- __construct() : mixed
- getConnection() : mixed
- {@inheritdoc}
- getConnectionNames() : mixed
- {@inheritdoc}
- getConnections() : mixed
- {@inheritdoc}
- getDefaultConnectionName() : mixed
- {@inheritdoc}
- getDefaultManagerName() : string
- Gets the default object manager name.
- getManager() : ObjectManager
- Gets a named object manager.
- getManagerForClass() : ObjectManager|null
- Gets the object manager associated with a given class.
- getManagerNames() : array<string, string>
- Gets all object manager names and associated service IDs. A service ID is a string that allows to obtain an object manager, typically from a PSR-11 container.
- getManagers() : array<string, ObjectManager>
- Gets an array of all registered object managers.
- getName() : string
- Gets the name of the registry.
- getRepository() : ObjectRepository
- Gets the ObjectRepository for a persistent object.
- resetManager() : ObjectManager
- Resets a named object manager.
- getService() : ObjectManager
- Fetches/creates the given services.
- resetService() : void
- Resets the given services.
- selectManager() : ObjectManager
Properties
$connections
private
array<string, string>
$connections
$defaultConnection
private
string
$defaultConnection
$defaultManager
private
string
$defaultManager
$managers
private
array<string, string>
$managers
$name
private
string
$name
$proxyInterfaceName
private
string
$proxyInterfaceName
Tags
Methods
__construct()
public
__construct(string $name, array<string, string> $connections, array<string, string> $managers, string $defaultConnection, string $defaultManager, string $proxyInterfaceName) : mixed
Parameters
- $name : string
- $connections : array<string, string>
- $managers : array<string, string>
- $defaultConnection : string
- $defaultManager : string
- $proxyInterfaceName : string
Tags
getConnection()
{@inheritdoc}
public
getConnection([string|null $name = null ]) : mixed
Parameters
- $name : string|null = null
getConnectionNames()
{@inheritdoc}
public
getConnectionNames() : mixed
getConnections()
{@inheritdoc}
public
getConnections() : mixed
getDefaultConnectionName()
{@inheritdoc}
public
getDefaultConnectionName() : mixed
getDefaultManagerName()
Gets the default object manager name.
public
getDefaultManagerName() : string
Return values
string —The default object manager name.
getManager()
Gets a named object manager.
public
getManager([string|null $name = null ]) : ObjectManager
Parameters
- $name : string|null = null
-
The object manager name (null for the default one).
Tags
Return values
ObjectManagergetManagerForClass()
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|nullgetManagerNames()
Gets all object manager names and associated service IDs. A service ID is a string that allows to obtain an object manager, typically from a PSR-11 container.
public
getManagerNames() : array<string, string>
Return values
array<string, string> —An array with object manager names as keys, and service IDs as values.
getManagers()
Gets an array of all registered object managers.
public
getManagers() : array<string, ObjectManager>
Return values
array<string, ObjectManager> —An array of ObjectManager instances
getName()
Gets the name of the registry.
public
getName() : string
Return values
stringgetRepository()
Gets the ObjectRepository for a persistent object.
public
getRepository(string $persistentObject[, string|null $persistentManagerName = null ]) : ObjectRepository
Parameters
- $persistentObject : string
-
The name of the persistent object.
- $persistentManagerName : string|null = null
-
The object manager name (null for the default one).
Return values
ObjectRepositoryresetManager()
Resets a named object manager.
public
resetManager([string|null $name = null ]) : ObjectManager
Parameters
- $name : string|null = null
-
The object manager name (null for the default one).
Return values
ObjectManagergetService()
Fetches/creates the given services.
protected
abstract getService(string $name) : ObjectManager
A service in this context is connection or a manager instance.
Parameters
- $name : string
-
The name of the service.
Return values
ObjectManager —The instance of the given service.
resetService()
Resets the given services.
protected
abstract resetService(string $name) : void
A service in this context is connection or a manager instance.
Parameters
- $name : string
-
The name of the service.
selectManager()
private
selectManager(string $persistentObject[, string|null $persistentManagerName = null ]) : ObjectManager
Parameters
- $persistentObject : string
- $persistentManagerName : string|null = null