3
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
12
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
13
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
15
* This software consists of voluntary contributions made by many individuals
16
* and is licensed under the MIT license. For more information, see
17
* <http://www.doctrine-project.org>.
20
namespace Doctrine\Common\Persistence;
23
* Contract covering object managers for a Doctrine persistence layer ManagerRegistry class to implement.
25
* @link www.doctrine-project.org
27
* @author Fabien Potencier <fabien@symfony.com>
28
* @author Benjamin Eberlei <kontakt@beberlei.de>
29
* @author Lukas Kahwe Smith <smith@pooteeweet.org>
31
interface ManagerRegistry extends ConnectionRegistry
34
* Gets the default object manager name.
36
* @return string The default object manager name.
38
public function getDefaultManagerName();
41
* Gets a named object manager.
43
* @param string $name The object manager name (null for the default one).
45
* @return \Doctrine\Common\Persistence\ObjectManager
47
public function getManager($name = null);
50
* Gets an array of all registered object managers.
52
* @return \Doctrine\Common\Persistence\ObjectManager[] An array of ObjectManager instances
54
public function getManagers();
57
* Resets a named object manager.
59
* This method is useful when an object manager has been closed
60
* because of a rollbacked transaction AND when you think that
61
* it makes sense to get a new one to replace the closed one.
63
* Be warned that you will get a brand new object manager as
64
* the existing one is not useable anymore. This means that any
65
* other object with a dependency on this object manager will
66
* hold an obsolete reference. You can inject the registry instead
67
* to avoid this problem.
69
* @param string|null $name The object manager name (null for the default one).
71
* @return \Doctrine\Common\Persistence\ObjectManager
73
public function resetManager($name = null);
76
* Resolves a registered namespace alias to the full namespace.
78
* This method looks for the alias in all registered object managers.
80
* @param string $alias The alias.
82
* @return string The full namespace.
84
public function getAliasNamespace($alias);
87
* Gets all connection names.
89
* @return array An array of connection names.
91
public function getManagerNames();
94
* Gets the ObjectRepository for an persistent object.
96
* @param string $persistentObject The name of the persistent object.
97
* @param string $persistentManagerName The object manager name (null for the default one).
99
* @return \Doctrine\Common\Persistence\ObjectRepository
101
public function getRepository($persistentObject, $persistentManagerName = null);
104
* Gets the object manager associated with a given class.
106
* @param string $class A persistent object class name.
108
* @return \Doctrine\Common\Persistence\ObjectManager|null
110
public function getManagerForClass($class);