EstimateAddress.php 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Quote\Model;
  7. use Magento\Framework\Model\AbstractExtensibleModel;
  8. use Magento\Quote\Api\Data\EstimateAddressInterface;
  9. class EstimateAddress extends AbstractExtensibleModel implements EstimateAddressInterface
  10. {
  11. /**
  12. * Get region name
  13. *
  14. * @return string
  15. */
  16. public function getRegion()
  17. {
  18. return $this->getData(self::KEY_REGION);
  19. }
  20. /**
  21. * Set region name
  22. *
  23. * @param string $region
  24. * @return $this
  25. */
  26. public function setRegion($region)
  27. {
  28. return $this->setData(self::KEY_REGION, $region);
  29. }
  30. /**
  31. * Get region id
  32. *
  33. * @return int
  34. */
  35. public function getRegionId()
  36. {
  37. return $this->getData(self::KEY_REGION_ID);
  38. }
  39. /**
  40. * Set region id
  41. *
  42. * @param int $regionId
  43. * @return $this
  44. */
  45. public function setRegionId($regionId)
  46. {
  47. return $this->setData(self::KEY_REGION_ID, $regionId);
  48. }
  49. /**
  50. * Get country id
  51. *
  52. * @return string
  53. */
  54. public function getCountryId()
  55. {
  56. return $this->getData(self::KEY_COUNTRY_ID);
  57. }
  58. /**
  59. * Set country id
  60. *
  61. * @param string $countryId
  62. * @return $this
  63. */
  64. public function setCountryId($countryId)
  65. {
  66. return $this->setData(self::KEY_COUNTRY_ID, $countryId);
  67. }
  68. /**
  69. * Get postcode
  70. *
  71. * @return string
  72. */
  73. public function getPostcode()
  74. {
  75. return $this->getData(self::KEY_POSTCODE);
  76. }
  77. /**
  78. * Set postcode
  79. *
  80. * @param string $postcode
  81. * @return $this
  82. */
  83. public function setPostcode($postcode)
  84. {
  85. return $this->setData(self::KEY_POSTCODE, $postcode);
  86. }
  87. /**
  88. * Retrieve existing extension attributes object or create a new one.
  89. *
  90. * @return \Magento\Quote\Api\Data\EstimateAddressExtensionInterface|null
  91. */
  92. public function getExtensionAttributes()
  93. {
  94. return $this->_getExtensionAttributes();
  95. }
  96. /**
  97. * Set an extension attributes object.
  98. *
  99. * @param \Magento\Quote\Api\Data\EstimateAddressExtensionInterface $extensionAttributes
  100. * @return $this
  101. */
  102. public function setExtensionAttributes(
  103. \Magento\Quote\Api\Data\EstimateAddressExtensionInterface $extensionAttributes
  104. ) {
  105. $this->_setExtensionAttributes($extensionAttributes);
  106. }
  107. }