QuotePickupLocation.php 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. <?php
  2. /**
  3. * Refer to LICENSE.txt distributed with the Temando Shipping module for notice of license
  4. */
  5. namespace Temando\Shipping\Model\Delivery;
  6. use Magento\Framework\Model\AbstractModel;
  7. use Temando\Shipping\Api\Data\Delivery\QuotePickupLocationInterface;
  8. use Temando\Shipping\Model\ResourceModel\Delivery\QuotePickupLocation as PickupLocationResource;
  9. /**
  10. * Temando Quote Pickup Location Entity
  11. *
  12. * This model contains a subset of data that is used in the shipping module.
  13. * It does not contain all data as available in its platform representation.
  14. *
  15. * @package Temando\Shipping\Model
  16. * @author Sebastian Ertner <sebastian.ertner@netresearch.de>
  17. * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
  18. * @link https://www.temando.com/
  19. */
  20. class QuotePickupLocation extends AbstractModel implements QuotePickupLocationInterface
  21. {
  22. /**
  23. * Init resource model.
  24. * @return void
  25. */
  26. protected function _construct()
  27. {
  28. parent::_construct();
  29. $this->_init(PickupLocationResource::class);
  30. }
  31. /**
  32. * @return int
  33. */
  34. public function getEntityId()
  35. {
  36. return $this->getData(QuotePickupLocationInterface::ENTITY_ID);
  37. }
  38. /**
  39. * @return string
  40. */
  41. public function getPickupLocationId()
  42. {
  43. return $this->getData(QuotePickupLocationInterface::PICKUP_LOCATION_ID);
  44. }
  45. /**
  46. * @return int
  47. */
  48. public function getRecipientAddressId()
  49. {
  50. return $this->getData(QuotePickupLocationInterface::RECIPIENT_ADDRESS_ID);
  51. }
  52. /**
  53. * @return string
  54. */
  55. public function getName()
  56. {
  57. return $this->getData(QuotePickupLocationInterface::NAME);
  58. }
  59. /**
  60. * @return string
  61. */
  62. public function getCountry()
  63. {
  64. return $this->getData(QuotePickupLocationInterface::COUNTRY);
  65. }
  66. /**
  67. * @return string
  68. */
  69. public function getRegion()
  70. {
  71. return $this->getData(QuotePickupLocationInterface::REGION);
  72. }
  73. /**
  74. * @return string
  75. */
  76. public function getPostcode()
  77. {
  78. return $this->getData(QuotePickupLocationInterface::POSTCODE);
  79. }
  80. /**
  81. * @return string
  82. */
  83. public function getCity()
  84. {
  85. return $this->getData(QuotePickupLocationInterface::CITY);
  86. }
  87. /**
  88. * @return string[]
  89. */
  90. public function getStreet()
  91. {
  92. return $this->getData(QuotePickupLocationInterface::STREET);
  93. }
  94. /**
  95. * @return int Distance in meters
  96. */
  97. public function getDistance()
  98. {
  99. return $this->getData(QuotePickupLocationInterface::DISTANCE);
  100. }
  101. /**
  102. * @return string[][]
  103. */
  104. public function getOpeningHours()
  105. {
  106. return $this->getData(QuotePickupLocationInterface::OPENING_HOURS);
  107. }
  108. /**
  109. * @return string[][]
  110. */
  111. public function getShippingExperiences()
  112. {
  113. return $this->getData(QuotePickupLocationInterface::SHIPPING_EXPERIENCES);
  114. }
  115. /**
  116. * @return bool
  117. */
  118. public function isSelected()
  119. {
  120. return $this->getData(QuotePickupLocationInterface::SELECTED);
  121. }
  122. }