AmountInterface.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Framework\Pricing\Amount;
  7. /**
  8. * Amount interface, the amount values are in display currency
  9. *
  10. * @api
  11. * @since 100.0.2
  12. */
  13. interface AmountInterface
  14. {
  15. /**
  16. * Return full amount value
  17. *
  18. * @param null|string|array $exclude
  19. * @return float
  20. */
  21. public function getValue($exclude = null);
  22. /**
  23. * Return full amount value in string format
  24. *
  25. * @return string
  26. */
  27. public function __toString();
  28. /**
  29. * Return base amount part value
  30. *
  31. * @return float
  32. */
  33. public function getBaseAmount();
  34. /**
  35. * Return adjustment amount part value by adjustment code
  36. *
  37. * @param string $adjustmentCode
  38. * @return float
  39. */
  40. public function getAdjustmentAmount($adjustmentCode);
  41. /**
  42. * Return sum amount of all applied adjustments
  43. *
  44. * @return float
  45. */
  46. public function getTotalAdjustmentAmount();
  47. /**
  48. * Return all applied adjustments as array
  49. *
  50. * @return float[]
  51. */
  52. public function getAdjustmentAmounts();
  53. /**
  54. * Check if adjustment is contained in amount object
  55. *
  56. * @param string $adjustmentCode
  57. * @return boolean
  58. */
  59. public function hasAdjustment($adjustmentCode);
  60. }