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

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