1 | <?php |
||
13 | class EntityManagerFactory |
||
14 | { |
||
15 | /** |
||
16 | * @var Application |
||
17 | */ |
||
18 | private $application; |
||
19 | |||
20 | /** |
||
21 | * @var TokenProvider |
||
22 | */ |
||
23 | private $tokenProvider; |
||
24 | |||
25 | /** |
||
26 | * @var string Annotation cache directory |
||
27 | */ |
||
28 | private $annotationCacheDirectory; |
||
29 | |||
30 | /** |
||
31 | * @var string Proxy cache directory |
||
32 | */ |
||
33 | private $proxyCacheDirectory; |
||
34 | |||
35 | /** |
||
36 | * @param Application $phraseanetApplication |
||
37 | * @param TokenProvider $tokenProvider |
||
38 | */ |
||
39 | 8 | public function __construct( |
|
46 | |||
47 | /** |
||
48 | * @param string $path |
||
49 | */ |
||
50 | 1 | public function setAnnotationCacheDirectory($path) |
|
54 | |||
55 | /** |
||
56 | * @param string $path |
||
57 | */ |
||
58 | 1 | public function setProxyCacheDirectory($path) |
|
62 | |||
63 | /** |
||
64 | * @return \PhraseanetSDK\EntityManager |
||
65 | */ |
||
66 | 8 | public function getEntityManager() |
|
77 | |||
78 | /** |
||
79 | * @param $name |
||
80 | * @return \PhraseanetSDK\AbstractRepository |
||
81 | */ |
||
82 | 3 | public function getRepository($name) |
|
108 | |||
109 | /** |
||
110 | * Builds the options array used to build SDK entity managers |
||
111 | * |
||
112 | * @return array |
||
113 | */ |
||
114 | 8 | private function getOptions() |
|
132 | |||
133 | /** |
||
134 | * Creates a directory matching requested path if it does not exist |
||
135 | * |
||
136 | * @param string $path |
||
137 | */ |
||
138 | 2 | private function ensureDirectoryExists($path) |
|
144 | |||
145 | /** |
||
146 | * Creates a ProxyManager configuration instance |
||
147 | * |
||
148 | * @return Configuration |
||
149 | */ |
||
150 | 3 | private function getProxyFactoryConfiguration() |
|
161 | } |
||
162 |