AbstractReport.php 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Entity\Message;
  4. use App\Entity\Access\Access;
  5. use App\Entity\Organization\Organization;
  6. use App\Enum\Message\ReportMessageStatusEnum;
  7. use Doctrine\DBAL\Types\Types;
  8. use Symfony\Component\Validator\Constraints as Assert;
  9. use Doctrine\ORM\Mapping as ORM;
  10. /**
  11. * Classe ... qui ...
  12. */
  13. #[ORM\MappedSuperclass]
  14. class AbstractReport
  15. {
  16. #[ORM\Column(type: 'datetime', nullable: true)]
  17. protected ?\DatetimeInterface $dateSend;
  18. #[ORM\Column(length: 255)]
  19. #[Assert\Choice(callback: [ReportMessageStatusEnum::class, 'toArray'], message: 'invalid-report-type')]
  20. protected string $status;
  21. #[ORM\ManyToOne(inversedBy: 'report')]
  22. protected ?Access $access;
  23. #[ORM\ManyToOne(inversedBy: 'report')]
  24. protected ?Organization $organization;
  25. /**
  26. * @deprecated Ne sert qu'à la rétrocompatibilité avec la V1, pourra être supprimé une fois la migration terminée
  27. * @var string
  28. */
  29. #[ORM\Column(length: 255)]
  30. private string $recipientType = '(ap2i)';
  31. /**
  32. * @deprecated Ne sert qu'à la rétrocompatibilité avec la V1, pourra être supprimé une fois la migration terminée
  33. */
  34. #[ORM\Column(type: Types::INTEGER)]
  35. private int $recipientId = 0;
  36. public function getDateSend(): ?\DatetimeInterface
  37. {
  38. return $this->dateSend;
  39. }
  40. public function setDateSend(?\DatetimeInterface $dateSend): self
  41. {
  42. $this->dateSend = $dateSend;
  43. return $this;
  44. }
  45. public function getStatus(): string
  46. {
  47. return $this->status;
  48. }
  49. public function setStatus(string $status): self
  50. {
  51. $this->status = $status;
  52. return $this;
  53. }
  54. public function getAccess(): ?Access
  55. {
  56. return $this->access;
  57. }
  58. public function setAccess(?Access $access): self
  59. {
  60. $this->access = $access;
  61. return $this;
  62. }
  63. public function getOrganization(): ?Organization
  64. {
  65. return $this->organization;
  66. }
  67. public function setOrganization(?Organization $organization): self
  68. {
  69. $this->organization = $organization;
  70. return $this;
  71. }
  72. /**
  73. * @deprecated Ne sert qu'à la rétrocompatibilité avec la V1, pourra être supprimé une fois la migration terminée
  74. * @return string
  75. */
  76. public function getRecipientType(): string
  77. {
  78. return $this->recipientType;
  79. }
  80. /**
  81. * @deprecated Ne sert qu'à la rétrocompatibilité avec la V1, pourra être supprimé une fois la migration terminée
  82. * @param string $recipientType
  83. */
  84. public function setRecipientType(string $recipientType): void
  85. {
  86. $this->recipientType = $recipientType;
  87. }
  88. /**
  89. * @deprecated Ne sert qu'à la rétrocompatibilité avec la V1, pourra être supprimé une fois la migration terminée
  90. * @return int
  91. */
  92. public function getRecipientId(): int
  93. {
  94. return $this->recipientId;
  95. }
  96. /**
  97. * @deprecated Ne sert qu'à la rétrocompatibilité avec la V1, pourra être supprimé une fois la migration terminée
  98. * @param int $recipientId
  99. */
  100. public function setRecipientId(int $recipientId): void
  101. {
  102. $this->recipientId = $recipientId;
  103. }
  104. }