| Methods |
public
|
getDefaultManagerName(): string
Gets the default object manager name.
Gets the default object manager name.
Returns
The default object manager name.
|
#
|
public
|
getManager(string|null $name = null): ObjectManager
Gets a named object manager.
Gets a named object manager.
Parameters
| $name |
The object manager name (null for the default one).
|
|
#
|
public
|
getManagers(): array<string, ObjectManager>
Gets an array of all registered object managers.
Gets an array of all registered object managers.
Returns
An array of ObjectManager instances
|
#
|
public
|
resetManager(string|null $name = null): ObjectManager
Resets a named object manager.
Resets a named object manager.
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 |
The object manager name (null for the default one).
|
|
#
|
public
|
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…
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.
Returns
An array with object manager names as keys,
and service IDs as values.
|
#
|
public
|
getRepository<T is object>(
class-string<T> $persistentObject,
string|null $persistentManagerName = null,
): ObjectRepository
Gets the ObjectRepository for a persistent object.
Gets the ObjectRepository for a persistent object.
Parameters
| $persistentManagerName |
The object manager name (null for the default one).
|
|
#
|
public
|
getManagerForClass(class-string $class): ObjectManager|null
Gets the object manager associated with a given class.
Gets the object manager associated with a given class.
Parameters
| $class |
A persistent object class name.
|
|
#
|