CollectionPointSearchRequest.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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\CollectionPointSearchRequestInterface;
  8. use Temando\Shipping\Model\ResourceModel\Delivery\CollectionPointSearchRequest as SearchRequestResource;
  9. /**
  10. * Temando Collection Point Search Request
  11. *
  12. * @package Temando\Shipping\Model
  13. * @author Christoph Aßmann <christoph.assmann@netresearch.de>
  14. * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
  15. * @link https://www.temando.com/
  16. */
  17. class CollectionPointSearchRequest extends AbstractModel implements CollectionPointSearchRequestInterface
  18. {
  19. /**
  20. * Init resource model.
  21. * @return void
  22. */
  23. protected function _construct()
  24. {
  25. parent::_construct();
  26. $this->_init(SearchRequestResource::class);
  27. }
  28. /**
  29. * @return int
  30. */
  31. public function getShippingAddressId()
  32. {
  33. return $this->getData(CollectionPointSearchRequestInterface::SHIPPING_ADDRESS_ID);
  34. }
  35. /**
  36. * @return string
  37. */
  38. public function getCountryId()
  39. {
  40. return $this->getData(CollectionPointSearchRequestInterface::COUNTRY_ID);
  41. }
  42. /**
  43. * @return string
  44. */
  45. public function getPostcode()
  46. {
  47. return $this->getData(CollectionPointSearchRequestInterface::POSTCODE);
  48. }
  49. /**
  50. * @return bool
  51. */
  52. public function isPending()
  53. {
  54. return (bool)$this->getData(CollectionPointSearchRequestInterface::PENDING);
  55. }
  56. }