CurrencyInformation.php 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. <?php
  2. /**
  3. * Data Model implementing the Address interface
  4. *
  5. * Copyright © Magento, Inc. All rights reserved.
  6. * See COPYING.txt for license details.
  7. */
  8. namespace Magento\Directory\Model\Data;
  9. /**
  10. * Class Currency Information
  11. *
  12. * @codeCoverageIgnore
  13. */
  14. class CurrencyInformation extends \Magento\Framework\Api\AbstractExtensibleObject implements
  15. \Magento\Directory\Api\Data\CurrencyInformationInterface
  16. {
  17. const KEY_BASE_CURRENCY_CODE = 'base_currency_code';
  18. const KEY_BASE_CURRENCY_SYMBOL = 'base_currency_symbol';
  19. const KEY_DEFAULT_DISPLAY_CURRENCY_CODE = 'default_display_currency_code';
  20. const KEY_DEFAULT_DISPLAY_CURRENCY_SYMBOL = 'default_display_currency_symbol';
  21. const KEY_AVAILABLE_CURRENCY_CODES = 'available_currency_codes';
  22. const KEY_EXCHANGE_RATES = 'exchange_rates';
  23. /**
  24. * @inheritDoc
  25. */
  26. public function getBaseCurrencyCode()
  27. {
  28. return $this->_get(self::KEY_BASE_CURRENCY_CODE);
  29. }
  30. /**
  31. * @inheritDoc
  32. */
  33. public function setBaseCurrencyCode($code)
  34. {
  35. return $this->setData(self::KEY_BASE_CURRENCY_CODE, $code);
  36. }
  37. /**
  38. * @inheritDoc
  39. */
  40. public function getBaseCurrencySymbol()
  41. {
  42. return $this->_get(self::KEY_BASE_CURRENCY_SYMBOL);
  43. }
  44. /**
  45. * @inheritDoc
  46. */
  47. public function setBaseCurrencySymbol($symbol)
  48. {
  49. return $this->setData(self::KEY_BASE_CURRENCY_SYMBOL, $symbol);
  50. }
  51. /**
  52. * @inheritDoc
  53. */
  54. public function getDefaultDisplayCurrencyCode()
  55. {
  56. return $this->_get(self::KEY_DEFAULT_DISPLAY_CURRENCY_CODE);
  57. }
  58. /**
  59. * @inheritDoc
  60. */
  61. public function setDefaultDisplayCurrencyCode($code)
  62. {
  63. return $this->setData(self::KEY_DEFAULT_DISPLAY_CURRENCY_CODE, $code);
  64. }
  65. /**
  66. * @inheritDoc
  67. */
  68. public function getDefaultDisplayCurrencySymbol()
  69. {
  70. return $this->_get(self::KEY_DEFAULT_DISPLAY_CURRENCY_SYMBOL);
  71. }
  72. /**
  73. * @inheritDoc
  74. */
  75. public function setDefaultDisplayCurrencySymbol($symbol)
  76. {
  77. return $this->setData(self::KEY_DEFAULT_DISPLAY_CURRENCY_SYMBOL, $symbol);
  78. }
  79. /**
  80. * @inheritDoc
  81. */
  82. public function getAvailableCurrencyCodes()
  83. {
  84. return $this->_get(self::KEY_AVAILABLE_CURRENCY_CODES);
  85. }
  86. /**
  87. * @inheritDoc
  88. */
  89. public function setAvailableCurrencyCodes(array $codes = null)
  90. {
  91. return $this->setData(self::KEY_AVAILABLE_CURRENCY_CODES, $codes);
  92. }
  93. /**
  94. * @inheritDoc
  95. */
  96. public function getExchangeRates()
  97. {
  98. return $this->_get(self::KEY_EXCHANGE_RATES);
  99. }
  100. /**
  101. * @inheritDoc
  102. */
  103. public function setExchangeRates(array $exchangeRates = null)
  104. {
  105. return $this->setData(self::KEY_EXCHANGE_RATES, $exchangeRates);
  106. }
  107. /**
  108. * @inheritDoc
  109. */
  110. public function getExtensionAttributes()
  111. {
  112. return $this->_getExtensionAttributes();
  113. }
  114. /**
  115. * @inheritDoc
  116. */
  117. public function setExtensionAttributes(
  118. \Magento\Directory\Api\Data\CurrencyInformationExtensionInterface $extensionAttributes
  119. ) {
  120. return $this->_setExtensionAttributes($extensionAttributes);
  121. }
  122. }