Conditions | 3 |
Paths | 3 |
Total Lines | 16 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
46 | public function load($key) |
||
47 | { |
||
48 | $cacheId = $this->persister->getIdentifier($key); |
||
49 | $entry = GeneralUtility::makeInstance(CacheManager::class) |
||
50 | ->getCache('onpage_extension') |
||
51 | ->get($cacheId); |
||
52 | |||
53 | if ($entry === false) { |
||
54 | try { |
||
55 | $entry = $this->dataService->getApiResult($key); |
||
56 | } catch (ApiErrorException $e) { |
||
|
|||
57 | } |
||
58 | $this->persister->persist($entry, $key); |
||
59 | } |
||
60 | return json_decode($entry, true); |
||
61 | } |
||
62 | } |
||
63 |