InvoiceSent.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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\InvoiceSent as ResourceModel;
  9. /**
  10. * Model for storage of the invoice sent flag
  11. *
  12. * This model is primarily used to prevent accidental double commits to the Tax Log
  13. */
  14. class InvoiceSent extends AbstractModel
  15. {
  16. const FIELD_ID = ResourceModel::FIELD_ID;
  17. const FIELD_SENT = ResourceModel::FIELD_SENT;
  18. /**
  19. * @inheritdoc
  20. */
  21. protected function _construct()
  22. {
  23. $this->_init(ResourceModel::class);
  24. }
  25. /**
  26. * Get the Invoice ID
  27. *
  28. * @return int
  29. */
  30. public function getInvoiceId()
  31. {
  32. return $this->getId();
  33. }
  34. /**
  35. * Set the Invoice ID
  36. *
  37. * @param int $invoiceId
  38. * @return $this
  39. */
  40. public function setInvoiceId($invoiceId)
  41. {
  42. return $this->setId($invoiceId);
  43. }
  44. /**
  45. * Get whether or not the invoice was committed to Vertex
  46. *
  47. * @return bool
  48. */
  49. public function isSent()
  50. {
  51. return (bool)$this->getData(static::FIELD_SENT);
  52. }
  53. /**
  54. * Set whether or not the invoice was committed to Vertex
  55. *
  56. * @param bool $isSent
  57. * @return $this
  58. */
  59. public function setIsSent($isSent)
  60. {
  61. return $this->setData(static::FIELD_SENT, $isSent);
  62. }
  63. }