src/Entity/Scholar/PracticalCase/PracticalCaseResponse.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Scholar\PracticalCase;
  3. use App\Entity\Account\User;
  4. use App\Entity\Common\Assignable;
  5. use App\Repository\Scholar\PracticalCase\PracticalCaseResponseRepository;
  6. use App\Validator\Constraints\PracticalCaseResponseConstraint;
  7. use Doctrine\ORM\Mapping as ORM;
  8. use Symfony\Component\Validator\Constraints as Assert;
  9. #[
  10. ORM\Entity(repositoryClass: PracticalCaseResponseRepository::class),
  11. PracticalCaseResponseConstraint(),
  12. ]
  13. class PracticalCaseResponse extends Assignable
  14. {
  15. #[ORM\ManyToOne(targetEntity: PracticalCaseUser::class, inversedBy: 'practicalCaseResponses')]
  16. #[ORM\JoinColumn(nullable: false, onDelete: 'CASCADE')]
  17. private PracticalCaseUser $practicalCaseUser;
  18. #[ORM\Column(type: 'text', nullable: false)]
  19. #[Assert\NotBlank]
  20. private ?string $content;
  21. #[ORM\Column(type: 'text', nullable: true)]
  22. private ?string $correction;
  23. #[ORM\OneToOne(targetEntity: FilePracticalCaseResponse::class, cascade: ['persist', 'remove'], fetch: "EAGER")]
  24. #[ORM\JoinColumn(nullable: true)]
  25. private ?FilePracticalCaseResponse $file = null;
  26. #[ORM\Column(type: 'integer', nullable: false)]
  27. private int $status;
  28. #[ORM\ManyToOne(targetEntity: User::class)]
  29. #[ORM\JoinColumn(nullable: true, onDelete: 'SET NULL')]
  30. private ?User $correctedBy = null;
  31. #[ORM\Column(type: 'datetime', nullable: true)]
  32. private ?\DateTime $correctedAt;
  33. public function getCorrection(): ?string
  34. {
  35. return $this->correction;
  36. }
  37. public function setCorrection(?string $correction): self
  38. {
  39. $this->correction = $correction;
  40. return $this;
  41. }
  42. public function getCorrectedBy(): ?User
  43. {
  44. return $this->correctedBy;
  45. }
  46. public function setCorrectedBy(?User $correctedBy): self
  47. {
  48. $this->correctedBy = $correctedBy;
  49. return $this;
  50. }
  51. public function getFile(): ?FilePracticalCaseResponse
  52. {
  53. return $this->file;
  54. }
  55. public function setFile(?FilePracticalCaseResponse $file): self
  56. {
  57. $this->file = $file;
  58. return $this;
  59. }
  60. public function getPracticalCaseUser(): PracticalCaseUser
  61. {
  62. return $this->practicalCaseUser;
  63. }
  64. public function setPracticalCaseUser(PracticalCaseUser $practicalCaseUser): PracticalCaseResponse
  65. {
  66. $this->practicalCaseUser = $practicalCaseUser;
  67. return $this;
  68. }
  69. public function getContent(): ?string
  70. {
  71. return $this->content;
  72. }
  73. public function setContent(?string $content): PracticalCaseResponse
  74. {
  75. $this->content = $content;
  76. return $this;
  77. }
  78. public function getStatus(): int
  79. {
  80. return $this->status;
  81. }
  82. public function setStatus(int $status): PracticalCaseResponse
  83. {
  84. $this->status = $status;
  85. return $this;
  86. }
  87. public function getCorrectedAt(): ?\DateTime
  88. {
  89. return $this->correctedAt;
  90. }
  91. public function setCorrectedAt(?\DateTime $correctedAt): PracticalCaseResponse
  92. {
  93. $this->correctedAt = $correctedAt;
  94. return $this;
  95. }
  96. }