5 use Cache\Taggable\TaggableItemInterface;
8 use Psr\Cache\CacheItemPoolInterface;
33 $this->currencies = $currencies;
42 $item = $this->pool->getItem(
'currency|availability|'.$currency->
getCode());
44 if (
false === $item->isHit()) {
45 $item->set($this->currencies->contains($currency));
47 if ($item instanceof TaggableItemInterface) {
48 $item->addTag(
'currency.availability');
51 $this->pool->save($item);
62 $item = $this->pool->getItem(
'currency|subunit|'.$currency->getCode());
64 if (
false === $item->isHit()) {
65 $item->set($this->currencies->subunitFor($currency));
67 if ($item instanceof TaggableItemInterface) {
68 $item->addTag(
'currency.subunit');
71 $this->pool->save($item);
82 return new \CallbackFilterIterator(
83 $this->currencies->getIterator(),
85 $item = $this->pool->getItem(
'currency|availability|'.$currency->getCode());
88 if ($item instanceof TaggableItemInterface) {
89 $item->addTag(
'currency.availability');
92 $this->pool->save($item);