ExchangeRate.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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 Exchange Rate
  11. *
  12. * @codeCoverageIgnore
  13. */
  14. class ExchangeRate extends \Magento\Framework\Api\AbstractExtensibleObject implements
  15. \Magento\Directory\Api\Data\ExchangeRateInterface
  16. {
  17. const KEY_CURRENCY_TO = 'currency_to';
  18. const KEY_RATE = 'rate';
  19. /**
  20. * @inheritDoc
  21. */
  22. public function getCurrencyTo()
  23. {
  24. return $this->_get(self::KEY_CURRENCY_TO);
  25. }
  26. /**
  27. * @inheritDoc
  28. */
  29. public function setCurrencyTo($code)
  30. {
  31. return $this->setData(self::KEY_CURRENCY_TO, $code);
  32. }
  33. /**
  34. * @inheritDoc
  35. */
  36. public function getRate()
  37. {
  38. return $this->_get(self::KEY_RATE);
  39. }
  40. /**
  41. * @inheritDoc
  42. */
  43. public function setRate($rate)
  44. {
  45. return $this->setData(self::KEY_RATE, $rate);
  46. }
  47. /**
  48. * @inheritDoc
  49. */
  50. public function getExchangeRates()
  51. {
  52. return $this->_get(self::KEY_EXCHANGE_RATES);
  53. }
  54. /**
  55. * @inheritDoc
  56. */
  57. public function setExchangeRates(array $exchangeRates = null)
  58. {
  59. return $this->setData(self::KEY_EXCHANGE_RATES, $exchangeRates);
  60. }
  61. /**
  62. * @inheritDoc
  63. */
  64. public function getExtensionAttributes()
  65. {
  66. return $this->_getExtensionAttributes();
  67. }
  68. /**
  69. * @inheritDoc
  70. */
  71. public function setExtensionAttributes(
  72. \Magento\Directory\Api\Data\ExchangeRateExtensionInterface $extensionAttributes
  73. ) {
  74. return $this->_setExtensionAttributes($extensionAttributes);
  75. }
  76. }