1 | <?php |
||
13 | class Configuration |
||
14 | { |
||
15 | /** |
||
16 | * The annotations reader used to know the access. |
||
17 | * |
||
18 | * @var Doctrine\Common\Annotations\Reader |
||
19 | */ |
||
20 | private static $annotationReader; |
||
21 | |||
22 | /** |
||
23 | * The constraints validator. |
||
24 | * |
||
25 | * @var Symfony\Component\Validator\ConstraintValidator |
||
26 | */ |
||
27 | private static $constraintsValidator; |
||
28 | |||
29 | /** |
||
30 | * Says if the setter values have to be validated. |
||
31 | * |
||
32 | * @var bool |
||
33 | */ |
||
34 | private static $constraintsValidationEnabled = true; |
||
35 | |||
36 | /** |
||
37 | * Says if the Initialize and InitializeObject values have to |
||
38 | * be validated with constraints. |
||
39 | * |
||
40 | * @var bool |
||
41 | */ |
||
42 | private static $initializeValuesValidationEnabled = true; |
||
43 | |||
44 | /** |
||
45 | * The cache driver the library will use. |
||
46 | * |
||
47 | * @var Cache |
||
48 | */ |
||
49 | private static $cacheDriver; |
||
50 | |||
51 | /** |
||
52 | * The namespace of the cache driver. |
||
53 | * |
||
54 | * @var string |
||
55 | */ |
||
56 | private static $cacheDefaultNamespace = 'antares_accessible_'; |
||
57 | |||
58 | /** |
||
59 | * The in-memory cache that will be used. |
||
60 | * @var ArrayCache |
||
61 | */ |
||
62 | private static $arrayCache; |
||
63 | |||
64 | /** |
||
65 | * Get the annotation reader that is used. |
||
66 | * Initializes it if it doesn't already exists. |
||
67 | * |
||
68 | * @return Reader The annotation reader. |
||
69 | */ |
||
70 | 9 | public static function getAnnotationReader() |
|
78 | |||
79 | /** |
||
80 | * Set the annotation reader that will be used. |
||
81 | * |
||
82 | * @param Reader $annotationReader The annotation reader. |
||
83 | */ |
||
84 | 1 | public static function setAnnotationReader(Reader $annotationReader) |
|
88 | |||
89 | /** |
||
90 | * Get the constraints validator that is used. |
||
91 | * Initializes it if it doesn't already exists. |
||
92 | * |
||
93 | * @return ConstraintValidator The annotation reader. |
||
94 | */ |
||
95 | 39 | public static function getConstraintsValidator() |
|
105 | |||
106 | /** |
||
107 | * Set the constraints validator that will be used. |
||
108 | * |
||
109 | * @param ValidatorInterface $constraintsValidator The annotation reader. |
||
110 | */ |
||
111 | 1 | public static function setConstraintsValidator(ValidatorInterface $constraintsValidator) |
|
115 | |||
116 | /** |
||
117 | * Indicates if the constraints validation is enabled for the setters. |
||
118 | * |
||
119 | * @return boolean True if enabled, else false. |
||
120 | */ |
||
121 | 8 | public static function isConstraintsValidationEnabled() |
|
125 | |||
126 | /** |
||
127 | * Enable or disable the constraints validation for setters. |
||
128 | * |
||
129 | * @param bool $enabled True for enable, false for disable. |
||
130 | */ |
||
131 | 1 | public static function setConstraintsValidationEnabled($enabled) |
|
139 | |||
140 | /** |
||
141 | * Indicates if the constraints validation for Initialize and |
||
142 | * InitializeObject values is enabled or not. |
||
143 | * |
||
144 | * @return boolean True if enabled, else false. |
||
145 | */ |
||
146 | 39 | public static function isInitializeValuesValidationEnabled() |
|
150 | |||
151 | /** |
||
152 | * Enable or disable the constraints validation for Initialize and |
||
153 | * InitializeObject values. |
||
154 | * |
||
155 | * @param bool $enabled True for enable, false for disable. |
||
156 | */ |
||
157 | 1 | public static function setInitializeValuesValidationEnabled($enabled) |
|
165 | |||
166 | /** |
||
167 | * Set a cache driver. |
||
168 | * |
||
169 | * @param Cache $cacheToChange The cache to change. |
||
170 | * @param Cache $cache The cache driver. |
||
171 | * @param string $namespace The cache namespace. |
||
172 | */ |
||
173 | 3 | private static function setCache(Cache &$cacheToChange = null, Cache $cache = null, $namespace = null) |
|
187 | |||
188 | /** |
||
189 | * Get the cache driver that will be used. |
||
190 | * |
||
191 | * @return Cache The cache driver. |
||
192 | */ |
||
193 | 8 | public static function getCacheDriver() |
|
197 | |||
198 | /** |
||
199 | * Set the cache driver that will be used. |
||
200 | * |
||
201 | * @param Cache $cache The cache driver. |
||
202 | * @param string $namespace The cache namespace. |
||
203 | */ |
||
204 | 1 | public static function setCacheDriver(Cache $cache = null, $namespace = null) |
|
208 | |||
209 | /** |
||
210 | * Get the array cache that will be used. |
||
211 | * Initialize it if it doesn't already exist. |
||
212 | * |
||
213 | * @return Cache The cache driver. |
||
214 | */ |
||
215 | 39 | public static function getArrayCache() |
|
223 | |||
224 | /** |
||
225 | * Set the array cache that will be used. |
||
226 | * |
||
227 | * @param Cache $cache The cache driver. |
||
228 | * @param string $namespace The cache namespace. |
||
229 | */ |
||
230 | 2 | public static function setArrayCache(Cache $cache, $namespace = null) { |
|
233 | } |
||
234 |