src/Entity/TimsReceipt.php line 147

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use JsonSerializable;
  4. class TimsReceipt implements JsonSerializable {
  5. private $id;
  6. private $cashier;
  7. private $invoiceType;
  8. private $transactionType;
  9. private $traderSystemInvoiceNumber;
  10. private $payment;
  11. private $buyer;
  12. private $items;
  13. /**
  14. * @return mixed
  15. */
  16. public function getId()
  17. {
  18. return $this->id;
  19. }
  20. /**
  21. * @param mixed $id
  22. */
  23. public function setId($id): void
  24. {
  25. $this->id = $id;
  26. }
  27. /**
  28. * @return mixed
  29. */
  30. public function getCashier()
  31. {
  32. return $this->cashier;
  33. }
  34. /**
  35. * @param mixed $cashier
  36. */
  37. public function setCashier($cashier): void
  38. {
  39. $this->cashier = $cashier;
  40. }
  41. /**
  42. * @return mixed
  43. */
  44. public function getInvoiceType()
  45. {
  46. return $this->invoiceType;
  47. }
  48. /**
  49. * @param mixed $invoiceType
  50. */
  51. public function setInvoiceType($invoiceType): void
  52. {
  53. $this->invoiceType = $invoiceType;
  54. }
  55. /**
  56. * @return mixed
  57. */
  58. public function getTransactionType()
  59. {
  60. return $this->transactionType;
  61. }
  62. /**
  63. * @param mixed $transactionType
  64. */
  65. public function setTransactionType($transactionType): void
  66. {
  67. $this->transactionType = $transactionType;
  68. }
  69. /**
  70. * @return mixed
  71. */
  72. public function getTraderSystemInvoiceNumber()
  73. {
  74. return $this->traderSystemInvoiceNumber;
  75. }
  76. /**
  77. * @param mixed $traderSystemInvoiceNumber
  78. */
  79. public function setTraderSystemInvoiceNumber($traderSystemInvoiceNumber): void
  80. {
  81. $this->traderSystemInvoiceNumber = $traderSystemInvoiceNumber;
  82. }
  83. /**
  84. * @return mixed
  85. */
  86. public function getPayment()
  87. {
  88. return $this->payment;
  89. }
  90. /**
  91. * @param mixed $payment
  92. */
  93. public function setPayment($payment): void
  94. {
  95. $this->payment = $payment;
  96. }
  97. /**
  98. * @return mixed
  99. */
  100. public function getBuyer()
  101. {
  102. return $this->buyer;
  103. }
  104. /**
  105. * @param mixed $buyer
  106. */
  107. public function setBuyer($buyer): void
  108. {
  109. $this->buyer = $buyer;
  110. }
  111. /**
  112. * @return mixed
  113. */
  114. public function getItems()
  115. {
  116. return $this->items;
  117. }
  118. /**
  119. * @param mixed $items
  120. */
  121. public function setItems($items): void
  122. {
  123. $this->items = $items;
  124. }
  125. public function jsonSerialize() {
  126. // TODO: Implement jsonSerialize() method.
  127. $buyer = $this->buyer;
  128. if(!$buyer){
  129. $buyer = null;
  130. }
  131. return array(
  132. 'cashier' => $this->cashier,
  133. 'invoiceType'=> $this->invoiceType,
  134. 'transactionType' => $this->transactionType,
  135. 'traderSystemInvoiceNumber' => $this->traderSystemInvoiceNumber,
  136. 'payment' => [
  137. 'amount' => $this->payment['amount'],
  138. 'paymentType' => $this->payment['paymentType']
  139. ],
  140. 'items' => $this->items,
  141. 'buyer' => $buyer
  142. );
  143. }
  144. }