| @@ 48-60 (lines=13) @@ | ||
| 45 | /** |
|
| 46 | * {@inheritdoc} |
|
| 47 | */ |
|
| 48 | public function getAllRatesExchanges(\DateTime $date = null) |
|
| 49 | { |
|
| 50 | $cacheKey = $this->createCacheKey('submarine_nbrb', $date); |
|
| 51 | ||
| 52 | $result = $this->cache->fetch($cacheKey); |
|
| 53 | if ($result) { |
|
| 54 | return $result; |
|
| 55 | } |
|
| 56 | ||
| 57 | $result = $this->provider->getAllRatesExchanges($date); |
|
| 58 | $this->cache->save($cacheKey, $result, $this->lifetime); |
|
| 59 | return $result; |
|
| 60 | } |
|
| 61 | ||
| 62 | /** |
|
| 63 | * {@inheritdoc} |
|
| @@ 65-77 (lines=13) @@ | ||
| 62 | /** |
|
| 63 | * {@inheritdoc} |
|
| 64 | */ |
|
| 65 | public function getRatesExchanges(array $codes, \DateTime $date = null) |
|
| 66 | { |
|
| 67 | $cacheKey = $this->createCacheKey('submarine_nbrb_' . implode('', $codes), $date); |
|
| 68 | ||
| 69 | $result = $this->cache->fetch($cacheKey); |
|
| 70 | if ($result) { |
|
| 71 | return $result; |
|
| 72 | } |
|
| 73 | ||
| 74 | $result = $this->provider->getRatesExchanges($codes, $date); |
|
| 75 | $this->cache->save($cacheKey, $result, $this->lifetime); |
|
| 76 | return $result; |
|
| 77 | } |
|
| 78 | ||
| 79 | /** |
|
| 80 | * {@inheritdoc} |
|
| @@ 82-94 (lines=13) @@ | ||
| 79 | /** |
|
| 80 | * {@inheritdoc} |
|
| 81 | */ |
|
| 82 | public function getRateExchange($code, \DateTime $date = null) |
|
| 83 | { |
|
| 84 | $cacheKey = $this->createCacheKey('submarine_nbrb_' . $code, $date); |
|
| 85 | ||
| 86 | $result = $this->cache->fetch($cacheKey); |
|
| 87 | if ($result) { |
|
| 88 | return $result; |
|
| 89 | } |
|
| 90 | ||
| 91 | $result = $this->provider->getRateExchange($code, $date); |
|
| 92 | $this->cache->save($cacheKey, $result, $this->lifetime); |
|
| 93 | return $result; |
|
| 94 | } |
|
| 95 | ||
| 96 | /** |
|
| 97 | * {@inheritdoc} |
|