1 | <?php |
||
5 | abstract class LocaleAwareResultCache extends ResultCache |
||
6 | { |
||
7 | /** |
||
8 | * Locale to be used. |
||
9 | * If not set, application locale will be used. |
||
10 | * |
||
11 | * @var string |
||
12 | */ |
||
13 | protected $locale; |
||
14 | |||
15 | /** |
||
16 | * Return an array of supported application locales. |
||
17 | * |
||
18 | * @return array |
||
19 | */ |
||
20 | abstract public function supportedLocales(); |
||
21 | |||
22 | /** |
||
23 | * Sets locale. |
||
24 | * |
||
25 | * @param $locale |
||
26 | * |
||
27 | * @return LocaleAwareResultCache |
||
28 | */ |
||
29 | 1 | public function setLocale($locale) |
|
35 | |||
36 | /** |
||
37 | * Return concrete used cache key. |
||
38 | * |
||
39 | * @return string |
||
40 | */ |
||
41 | 5 | protected function getCacheKey() |
|
45 | |||
46 | /** |
||
47 | * Return cache key suffixed with locale. |
||
48 | * |
||
49 | * @param null|string $locale |
||
50 | * |
||
51 | * @return string |
||
52 | */ |
||
53 | 6 | protected function localizedKey($locale = null) |
|
57 | |||
58 | /** |
||
59 | * Removes cache for all locales. |
||
60 | */ |
||
61 | 1 | public function forget() |
|
67 | } |
||
68 |