/
RegistryInterface.php
94 lines (84 loc) · 2.58 KB
/
RegistryInterface.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bridge\Doctrine;
use Doctrine\Common\Persistence\ManagerRegistry as ManagerRegistryInterface;
use Doctrine\ORM\Configuration;
/**
* References Doctrine connections and entity managers.
*
* @author Fabien Potencier <fabien@symfony.com>
*/
interface RegistryInterface extends ManagerRegistryInterface
{
/**
* Gets the default entity manager name.
*
* @return string The default entity manager name
*/
public function getDefaultEntityManagerName();
/**
* Gets a named entity manager.
*
* @param string $name The entity manager name (null for the default one)
*
* @return EntityManager
*/
public function getEntityManager($name = null);
/**
* Gets an array of all registered entity managers
*
* @return array An array of EntityManager instances
*/
public function getEntityManagers();
/**
* Resets a named entity manager.
*
* 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 useable 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.
*
* @param string $name The entity manager name (null for the default one)
*
* @return EntityManager
*/
public function resetEntityManager($name = null);
/**
* Resolves a registered namespace alias to the full namespace.
*
* This method looks for the alias in all registered entity managers.
*
* @param string $alias The alias
*
* @return string The full namespace
*
* @see Configuration::getEntityNamespace
*/
public function getEntityNamespace($alias);
/**
* Gets all connection names.
*
* @return array An array of connection names
*/
public function getEntityManagerNames();
/**
* Gets the entity manager associated with a given class.
*
* @param string $class A Doctrine Entity class name
*
* @return EntityManager|null
*/
public function getEntityManagerForClass($class);
}