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 Initialize and InitializeObject values have to |
||
31 | * be validated with constraints. |
||
32 | * |
||
33 | * @var bool |
||
34 | */ |
||
35 | private static $initializeValuesValidationEnabled = true; |
||
36 | |||
37 | /** |
||
38 | * The cache driver the library will use. |
||
39 | * |
||
40 | * @var Cache |
||
41 | */ |
||
42 | private static $cacheDriver; |
||
43 | |||
44 | /** |
||
45 | * The namespace of the cache driver. |
||
46 | * |
||
47 | * @var string |
||
48 | */ |
||
49 | private static $cacheDefaultNamespace = 'antares_accessible_'; |
||
50 | |||
51 | /** |
||
52 | * The in-memory cache that will be used. |
||
53 | * @var ArrayCache |
||
54 | */ |
||
55 | private static $arrayCache; |
||
56 | |||
57 | /** |
||
58 | * Get the annotation reader that is used. |
||
59 | * Initializes it if it doesn't already exists. |
||
60 | * |
||
61 | * @return Reader The annotation reader. |
||
62 | */ |
||
63 | 30 | public static function getAnnotationReader() |
|
71 | |||
72 | /** |
||
73 | * Set the annotation reader that will be used. |
||
74 | * |
||
75 | * @param Reader $annotationReader The annotation reader. |
||
76 | */ |
||
77 | 1 | public static function setAnnotationReader(Reader $annotationReader) |
|
81 | |||
82 | /** |
||
83 | * Get the constraints validator that is used. |
||
84 | * Initializes it if it doesn't already exists. |
||
85 | * |
||
86 | * @return ConstraintValidator The annotation reader. |
||
87 | */ |
||
88 | 30 | public static function getConstraintsValidator() |
|
98 | |||
99 | /** |
||
100 | * Set the constraints validator that will be used. |
||
101 | * |
||
102 | * @param ValidatorInterface $constraintsValidator The annotation reader. |
||
103 | */ |
||
104 | 1 | public static function setConstraintsValidator(ValidatorInterface $constraintsValidator) |
|
108 | |||
109 | /** |
||
110 | * Indicates if the constraints validation for Initialize and |
||
111 | * InitializeObject values is enabled or not. |
||
112 | * |
||
113 | * @return boolean True if enabled, else false. |
||
114 | */ |
||
115 | 30 | public static function isInitializeValuesValidationEnabled() |
|
119 | |||
120 | /** |
||
121 | * Enable or disable the constraints validation for Initialize and |
||
122 | * InitializeObject values. |
||
123 | * |
||
124 | * @param bool $enabled True for enable, false for disable. |
||
125 | */ |
||
126 | 1 | public static function setInitializeValuesValidationEnabled($enabled) |
|
134 | |||
135 | /** |
||
136 | * Set a cache driver. |
||
137 | * |
||
138 | * @param Cache $cacheToChange The cache to change. |
||
139 | * @param Cache $cache The cache driver. |
||
140 | * @param string $namespace The cache namespace. |
||
141 | */ |
||
142 | 3 | private static function setCache(Cache &$cacheToChange = null, Cache $cache = null, $namespace = null) |
|
156 | |||
157 | /** |
||
158 | * Get the cache driver that will be used. |
||
159 | * |
||
160 | * @return Cache The cache driver. |
||
161 | */ |
||
162 | 29 | public static function getCacheDriver() |
|
166 | |||
167 | /** |
||
168 | * Set the cache driver that will be used. |
||
169 | * |
||
170 | * @param Cache $cache The cache driver. |
||
171 | * @param string $namespace The cache namespace. |
||
172 | */ |
||
173 | 1 | public static function setCacheDriver(Cache $cache = null, $namespace = null) |
|
177 | |||
178 | /** |
||
179 | * Get the array cache that will be used. |
||
180 | * Initialize it if it doesn't already exist. |
||
181 | * |
||
182 | * @return Cache The cache driver. |
||
183 | */ |
||
184 | 30 | public static function getArrayCache() |
|
192 | |||
193 | /** |
||
194 | * Set the array cache that will be used. |
||
195 | * |
||
196 | * @param Cache $cache The cache driver. |
||
197 | * @param string $namespace The cache namespace. |
||
198 | */ |
||
199 | 2 | public static function setArrayCache(Cache $cache = null, $namespace = null) { |
|
202 | } |
||
203 |