CustomerCode.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <?php
  2. /**
  3. * @copyright Vertex. All rights reserved. https://www.vertexinc.com/
  4. * @author Mediotype https://www.mediotype.com/
  5. */
  6. namespace Vertex\Tax\Model\Data;
  7. use Magento\Framework\Model\AbstractModel;
  8. use Vertex\Tax\Model\ResourceModel\CustomerCode as ResourceModel;
  9. /**
  10. * Model for storage of the Vertex Customer Code
  11. *
  12. * This model is used as the implementation for the vertex_customer_code extension attribute on the
  13. * {@see \Magento\Customer\Api\Data\CustomerInterface}
  14. */
  15. class CustomerCode extends AbstractModel
  16. {
  17. const FIELD_ID = ResourceModel::FIELD_ID;
  18. const FIELD_CODE = ResourceModel::FIELD_CODE;
  19. /**
  20. * @inheritdoc
  21. */
  22. protected function _construct()
  23. {
  24. $this->_init(ResourceModel::class);
  25. }
  26. /**
  27. * Get Vertex Customer Code
  28. *
  29. * @return string
  30. */
  31. public function getCustomerCode()
  32. {
  33. return $this->getData(static::FIELD_CODE);
  34. }
  35. /**
  36. * Set Vertex Customer Code
  37. *
  38. * @param string $customerCode
  39. * @return $this
  40. */
  41. public function setCustomerCode($customerCode)
  42. {
  43. return $this->setData(static::FIELD_CODE, $customerCode);
  44. }
  45. /**
  46. * Get Customer ID
  47. *
  48. * @return int
  49. */
  50. public function getCustomerId()
  51. {
  52. return $this->getId();
  53. }
  54. /**
  55. * Set Customer ID
  56. *
  57. * @param int $customerId
  58. * @return $this
  59. */
  60. public function setCustomerId($customerId)
  61. {
  62. return $this->setId($customerId);
  63. }
  64. }