Address.php 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <?php
  2. /**
  3. * Refer to LICENSE.txt distributed with the Temando Shipping module for notice of license
  4. */
  5. namespace Temando\Shipping\Model\Checkout;
  6. use Magento\Framework\Model\AbstractModel;
  7. use Temando\Shipping\Api\Data\Checkout\AddressInterface;
  8. use Temando\Shipping\Model\ResourceModel\Checkout\Address as AddressResource;
  9. /**
  10. * Checkout shipping address extension
  11. *
  12. * @package Temando\Shipping\Model
  13. * @author Christoph Aßmann <christoph.assmann@netresearch.de>
  14. * @author Sebastian Ertner <sebastian.ertner@netresearch.de>
  15. * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
  16. * @link http://www.temando.com/
  17. */
  18. class Address extends AbstractModel implements AddressInterface
  19. {
  20. /**
  21. * Init resource model.
  22. * @return void
  23. */
  24. protected function _construct()
  25. {
  26. parent::_construct();
  27. $this->_init(AddressResource::class);
  28. }
  29. /**
  30. * @return int
  31. */
  32. public function getEntityId()
  33. {
  34. return $this->getData(AddressInterface::ENTITY_ID);
  35. }
  36. /**
  37. * @param int $entityId
  38. * @return void
  39. */
  40. public function setEntityId($entityId)
  41. {
  42. $this->setData(AddressInterface::ENTITY_ID, $entityId);
  43. }
  44. /**
  45. * @return int
  46. */
  47. public function getShippingAddressId()
  48. {
  49. return $this->getData(AddressInterface::SHIPPING_ADDRESS_ID);
  50. }
  51. /**
  52. * @param int $addressId
  53. * @return void
  54. */
  55. public function setShippingAddressId($addressId)
  56. {
  57. $this->setData(AddressInterface::SHIPPING_ADDRESS_ID, $addressId);
  58. }
  59. /**
  60. * @return \Magento\Framework\Api\AttributeInterface[]
  61. */
  62. public function getServiceSelection()
  63. {
  64. return $this->getData(AddressInterface::SERVICE_SELECTION);
  65. }
  66. /**
  67. * @param \Magento\Framework\Api\AttributeInterface[] $services
  68. * @return void
  69. */
  70. public function setServiceSelection(array $services)
  71. {
  72. $this->setData(AddressInterface::SERVICE_SELECTION, $services);
  73. }
  74. }