1 | <?php |
||
13 | class CachedRemoteData |
||
14 | { |
||
15 | /** |
||
16 | * @var string |
||
17 | */ |
||
18 | private $url; |
||
19 | |||
20 | /** |
||
21 | * @var string |
||
22 | */ |
||
23 | private $key; |
||
24 | |||
25 | /** |
||
26 | * @var CacheItemPoolInterface |
||
27 | */ |
||
28 | private $cachePool; |
||
29 | |||
30 | /** |
||
31 | * @param CacheItemPoolInterface $cachePool |
||
32 | * @param string $url |
||
33 | * @param string $key |
||
34 | */ |
||
35 | 1 | public function __construct(CacheItemPoolInterface $cachePool, $url, $key = null) |
|
41 | |||
42 | /** |
||
43 | * @return CacheItemPoolInterface |
||
44 | */ |
||
45 | 1 | public function getCachePool() |
|
49 | |||
50 | /** |
||
51 | * @return string |
||
52 | */ |
||
53 | 1 | public function getUrl() |
|
57 | |||
58 | /** |
||
59 | * @return string |
||
60 | */ |
||
61 | 1 | public function getKey() |
|
65 | |||
66 | /** |
||
67 | * @return string |
||
68 | * @throws Exception If problems loading data |
||
69 | */ |
||
70 | 1 | public function get() |
|
83 | |||
84 | /** |
||
85 | * @return string |
||
86 | * @throws Exception If problems loading data |
||
87 | */ |
||
88 | 2 | public function load() |
|
109 | } |
||
110 |