Msrp.php 820 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Msrp\Model\Quote;
  7. /**
  8. * Class Msrp
  9. */
  10. class Msrp
  11. {
  12. /**
  13. * @var array
  14. */
  15. protected $canApplyMsrpData = [];
  16. /**
  17. * @param int $quoteId
  18. * @param bool $canApply
  19. * @return $this
  20. */
  21. public function setCanApplyMsrp($quoteId, $canApply)
  22. {
  23. $this->canApplyMsrpData[$quoteId] = (bool)$canApply;
  24. return $this;
  25. }
  26. /**
  27. * @param int $quoteId
  28. * @return bool
  29. * @SuppressWarnings(PHPMD.BooleanGetMethodName)
  30. */
  31. public function getCanApplyMsrp($quoteId)
  32. {
  33. if (isset($this->canApplyMsrpData[$quoteId])) {
  34. return (bool)$this->canApplyMsrpData[$quoteId];
  35. }
  36. return false;
  37. }
  38. }