Currency.php 857 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Framework;
  7. use Magento\Framework\App\CacheInterface;
  8. class Currency extends \Zend_Currency implements CurrencyInterface
  9. {
  10. /**
  11. * Creates a currency instance.
  12. *
  13. * @param CacheInterface $appCache
  14. * @param string|array $options Options array or currency short name when string is given
  15. * @param string $locale Locale name
  16. */
  17. public function __construct(
  18. CacheInterface $appCache,
  19. $options = null,
  20. $locale = null
  21. ) {
  22. // set Zend cache to low level frontend app cache
  23. $lowLevelFrontendCache = $appCache->getFrontend()->getLowLevelFrontend();
  24. \Zend_Currency::setCache($lowLevelFrontendCache);
  25. parent::__construct($options, $locale);
  26. }
  27. }