ErrorMessageDisplayState.php 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. /**
  3. * @copyright Vertex. All rights reserved. https://www.vertexinc.com/
  4. * @author Mediotype https://www.mediotype.com/
  5. */
  6. namespace Vertex\Tax\Model;
  7. /**
  8. * Used to decide when to enable the "Vertex cannot calculate taxes" error message
  9. */
  10. class ErrorMessageDisplayState
  11. {
  12. /** @var bool */
  13. private $enabled;
  14. /**
  15. * @param bool $enabled
  16. */
  17. public function __construct($enabled = false)
  18. {
  19. $this->enabled = $enabled;
  20. }
  21. /**
  22. * Determine if the failure to calculate taxes message is enabled
  23. *
  24. * @return bool
  25. */
  26. public function isEnabled()
  27. {
  28. return $this->enabled;
  29. }
  30. /**
  31. * Enable the failure to calculate taxes message
  32. *
  33. * @return void
  34. */
  35. public function enable()
  36. {
  37. $this->enabled = true;
  38. }
  39. /**
  40. * Disable the failure to calculate taxes message
  41. *
  42. * @return void
  43. */
  44. public function disable()
  45. {
  46. $this->enabled = false;
  47. }
  48. }