From bf6655a534a6775d30cafa67bd801276bda1d98d Mon Sep 17 00:00:00 2001 From: polo Date: Tue, 13 Aug 2024 23:45:21 +0200 Subject: =?UTF-8?q?VERSION=200.2=20doctrine=20ORM=20et=20entit=C3=A9s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/Persistence/ManagerRegistry.php | 89 ++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 vendor/doctrine/persistence/src/Persistence/ManagerRegistry.php (limited to 'vendor/doctrine/persistence/src/Persistence/ManagerRegistry.php') diff --git a/vendor/doctrine/persistence/src/Persistence/ManagerRegistry.php b/vendor/doctrine/persistence/src/Persistence/ManagerRegistry.php new file mode 100644 index 0000000..46599a5 --- /dev/null +++ b/vendor/doctrine/persistence/src/Persistence/ManagerRegistry.php @@ -0,0 +1,89 @@ + An array of ObjectManager instances + */ + public function getManagers(); + + /** + * 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. + * + * @param string|null $name The object manager name (null for the default one). + * + * @return ObjectManager + */ + public function resetManager(?string $name = null); + + /** + * 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. + * + * @return array An array with object manager names as keys, + * and service IDs as values. + */ + public function getManagerNames(); + + /** + * Gets the ObjectRepository for a persistent object. + * + * @param string $persistentObject The name of the persistent object. + * @param string|null $persistentManagerName The object manager name (null for the default one). + * @psalm-param class-string $persistentObject + * + * @return ObjectRepository + * @psalm-return ObjectRepository + * + * @template T of object + */ + public function getRepository( + string $persistentObject, + ?string $persistentManagerName = null + ); + + /** + * Gets the object manager associated with a given class. + * + * @param class-string $class A persistent object class name. + * + * @return ObjectManager|null + */ + public function getManagerForClass(string $class); +} -- cgit v1.2.3