src/Entity/RefundRequest.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use DateTime;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use App\Entity\Demande;
  6. use Symfony\Component\Validator\Constraints as Assert;
  7. /**
  8. * @ORM\Table(name="RefundRequest")
  9. * @ORM\Entity
  10. */
  11. class RefundRequest
  12. {
  13. public const STATUS_NEW = 0;
  14. public const STATUS_ACCEPTED = 1;
  15. public const STATUS_REFUSED = 2;
  16. /**
  17. * @var integer
  18. * @ORM\Column(name="id", type="integer")
  19. * @ORM\Id
  20. * @ORM\GeneratedValue(strategy="AUTO")
  21. */
  22. private $id;
  23. /**
  24. * @var string
  25. * @ORM\Column(name="status", type="string")
  26. */
  27. private $status;
  28. /**
  29. * @var Demande
  30. *
  31. * @ORM\ManyToOne(targetEntity="Demande", inversedBy="refundRequests")
  32. * @ORM\JoinColumn(name="demande_id", referencedColumnName="id")
  33. * @Assert\NotBlank(message="Veuillez choisir une demande de devis.")
  34. */
  35. private $demande;
  36. /**
  37. * @var Prestataire
  38. *
  39. * @ORM\ManyToOne(targetEntity="Prestataire", inversedBy="refundRequests")
  40. * @ORM\JoinColumn(name="prestataire_id", referencedColumnName="id")
  41. */
  42. private $prestataire;
  43. /**
  44. * @var string
  45. *
  46. * @ORM\Column(name="comment", type="text")
  47. * @Assert\NotBlank(message="Veuillez préciser le problème.")
  48. */
  49. private $comment;
  50. /**
  51. * @var Transaction
  52. * @ORM\OneToOne(targetEntity="Transaction")
  53. * @ORM\JoinColumn(name="transaction_id", referencedColumnName="id", nullable=true)
  54. */
  55. private $transaction;
  56. public function __construct()
  57. {
  58. $this->status = self::STATUS_NEW;
  59. }
  60. /**
  61. * Get id
  62. *
  63. * @return integer
  64. */
  65. public function getId()
  66. {
  67. return $this->id;
  68. }
  69. /**
  70. * Set comment
  71. *
  72. * @param string $comment
  73. * @return RefundRequest
  74. */
  75. public function setComment($comment)
  76. {
  77. $this->comment = $comment;
  78. return $this;
  79. }
  80. /**
  81. * Get comment
  82. *
  83. * @return string
  84. */
  85. public function getComment()
  86. {
  87. return $this->comment;
  88. }
  89. /**
  90. * Set demande
  91. *
  92. * @param Demande $demande
  93. * @return RefundRequest
  94. */
  95. public function setDemande(Demande $demande)
  96. {
  97. $this->demande = $demande;
  98. return $this;
  99. }
  100. /**
  101. * Get demande
  102. *
  103. * @return Demande
  104. */
  105. public function getDemande()
  106. {
  107. return $this->demande;
  108. }
  109. /**
  110. * @return Prestataire
  111. */
  112. public function getPrestataire()
  113. {
  114. return $this->prestataire;
  115. }
  116. /**
  117. * @param Prestataire $prestataire
  118. */
  119. public function setPrestataire($prestataire)
  120. {
  121. $this->prestataire = $prestataire;
  122. }
  123. /**
  124. * @return string
  125. */
  126. public function getStatus()
  127. {
  128. return $this->status;
  129. }
  130. /**
  131. * @param string $status
  132. */
  133. public function setStatus($status)
  134. {
  135. $this->status = $status;
  136. }
  137. public function setAccepted()
  138. {
  139. $this->status = self::STATUS_ACCEPTED;
  140. }
  141. public function setRefused()
  142. {
  143. $this->status = self::STATUS_REFUSED;
  144. }
  145. /**
  146. * @return Transaction
  147. */
  148. public function getTransaction()
  149. {
  150. return $this->transaction;
  151. }
  152. /**
  153. * @param Transaction $transaction
  154. */
  155. public function setTransaction($transaction)
  156. {
  157. $this->transaction = $transaction;
  158. }
  159. }