src/Entity/TransactionExpense.php line 20

Open in your IDE?
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: parcel
  5. * Date: 10/19/18
  6. * Time: 12:49 PM
  7. */
  8. namespace App\Entity;
  9. use Doctrine\ORM\Mapping as ORM;
  10. use JMS\Serializer\Annotation as Serializer;
  11. use Symfony\Component\Validator\Constraints as Assert;
  12. /**
  13. * @ORM\Entity
  14. * @ORM\Table(name="transaction_expense")
  15. */
  16. class TransactionExpense {
  17. /**
  18. * @ORM\Id
  19. * @ORM\GeneratedValue(strategy="IDENTITY")
  20. * @ORM\Column(type="integer")
  21. */
  22. private $id;
  23. /**
  24. * @Assert\NotBlank(message="Please Enter Amount")
  25. * @Assert\GreaterThanOrEqual(value="10", message="Please Enter A value More than 150")
  26. * @ORM\Column(type="float")
  27. */
  28. private $amount;
  29. /**
  30. * @var \App\Entity\Transaction
  31. * @Serializer\Type("App\Entity\Transaction")
  32. * @ORM\ManyToOne(targetEntity="Transaction", inversedBy="wayBillExpenses")
  33. * @ORM\JoinColumns({
  34. * @ORM\JoinColumn(name="transaction_id", referencedColumnName="id")
  35. * })
  36. */
  37. private $transaction;
  38. /**
  39. * @var \App\Entity\ExpenseType
  40. * @Serializer\Type("App\Entity\ExpenseType")
  41. * @ORM\ManyToOne(targetEntity="App\Entity\ExpenseType")
  42. * @ORM\JoinColumns({
  43. * @ORM\JoinColumn(name="expense_type", referencedColumnName="id")
  44. * })
  45. */
  46. private $expenseType;
  47. /**
  48. * @ORM\Column(type="datetime")
  49. */
  50. private $createdAt;
  51. /**
  52. * @var \App\Entity\User
  53. * @Serializer\Type("App\Entity\User")
  54. * @ORM\ManyToOne(targetEntity="App\Entity\User")
  55. * @ORM\JoinColumns({
  56. * @ORM\JoinColumn(name="created_by", referencedColumnName="id")
  57. * })
  58. */
  59. private $createdBy;
  60. /**
  61. * @return mixed
  62. */
  63. public function getId()
  64. {
  65. return $this->id;
  66. }
  67. /**
  68. * @param mixed $id
  69. */
  70. public function setId($id)
  71. {
  72. $this->id = $id;
  73. }
  74. /**
  75. * @return mixed
  76. */
  77. public function getAmount()
  78. {
  79. return $this->amount;
  80. }
  81. /**
  82. * @param mixed $amount
  83. */
  84. public function setAmount($amount)
  85. {
  86. $this->amount = $amount;
  87. }
  88. /**
  89. * @return Transaction
  90. */
  91. public function getTransaction()
  92. {
  93. return $this->transaction;
  94. }
  95. /**
  96. * @param Transaction $transaction
  97. */
  98. public function setTransaction($transaction)
  99. {
  100. $this->transaction = $transaction;
  101. }
  102. /**
  103. * @return ExpenseType
  104. */
  105. public function getExpenseType()
  106. {
  107. return $this->expenseType;
  108. }
  109. /**
  110. * @param ExpenseType $expenseType
  111. */
  112. public function setExpenseType($expenseType)
  113. {
  114. $this->expenseType = $expenseType;
  115. }
  116. /**
  117. * @return mixed
  118. */
  119. public function getCreatedAt()
  120. {
  121. return $this->createdAt;
  122. }
  123. /**
  124. * @param mixed $createdAt
  125. */
  126. public function setCreatedAt($createdAt)
  127. {
  128. $this->createdAt = $createdAt;
  129. }
  130. /**
  131. * @return User
  132. */
  133. public function getCreatedBy()
  134. {
  135. return $this->createdBy;
  136. }
  137. /**
  138. * @param User $createdBy
  139. */
  140. public function setCreatedBy($createdBy)
  141. {
  142. $this->createdBy = $createdBy;
  143. }
  144. }