src/Entity/ActionPlanComment.php line 18

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use ApiPlatform\Metadata\ApiResource;
  4. use App\Repository\ActionPlanCommentRepository;
  5. use Doctrine\DBAL\Types\Types;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Symfony\Component\Serializer\Annotation\Groups;
  8. use App\Traits\AutoTimestampTrait;
  9. #[ORM\Entity(repositoryClassActionPlanCommentRepository::class)]
  10. #[ApiResource(
  11.     normalizationContext: ['groups' => ['comment.get']],
  12.     denormalizationContext: ['groups' => ['comment.write']],
  13. )]
  14. #[ORM\HasLifecycleCallbacks]
  15. class ActionPlanComment
  16. {
  17.     use AutoTimestampTrait;
  18.     #[ORM\Id]
  19.     #[ORM\GeneratedValue]
  20.     #[ORM\Column]
  21.     #[Groups(['comment.get''plan.get'])]
  22.     private ?int $id null;
  23.     #[ORM\Column(typeTypes::TEXT)]
  24.     #[Groups(['comment.write''comment.get''plan.get'])]
  25.     private ?string $comment null;
  26.     #[ORM\ManyToOne]
  27.     #[Groups(['comment.write''comment.get''plan.get'])]
  28.     private ?User $createdBy null;
  29.     #[ORM\ManyToOne]
  30.     #[Groups(['comment.write''comment.get''plan.get'])]
  31.     private ?User $updatedBy null;
  32.     #[ORM\ManyToOne(inversedBy'actionPlanComments')]
  33.     #[ORM\JoinColumn(nullablefalse)]
  34.     #[Groups(['comment.write'])]
  35.     private ?ActionPlan $actionPlan null;
  36.     public function getId(): ?int
  37.     {
  38.         return $this->id;
  39.     }
  40.     public function getComment(): ?string
  41.     {
  42.         return $this->comment;
  43.     }
  44.     public function setComment(string $comment): self
  45.     {
  46.         $this->comment $comment;
  47.         return $this;
  48.     }
  49.     public function getCreatedBy(): ?User
  50.     {
  51.         return $this->createdBy;
  52.     }
  53.     public function setCreatedBy(?User $createdBy): self
  54.     {
  55.         $this->createdBy $createdBy;
  56.         return $this;
  57.     }
  58.     public function getUpdatedBy(): ?User
  59.     {
  60.         return $this->updatedBy;
  61.     }
  62.     public function setUpdatedBy(?User $updatedBy): self
  63.     {
  64.         $this->updatedBy $updatedBy;
  65.         return $this;
  66.     }
  67.     public function getActionPlan(): ?ActionPlan
  68.     {
  69.         return $this->actionPlan;
  70.     }
  71.     public function setActionPlan(?ActionPlan $actionPlan): self
  72.     {
  73.         $this->actionPlan $actionPlan;
  74.         return $this;
  75.     }
  76. //    public function getUpdatedAt(): ?\DateTimeInterface
  77. //    {
  78. //        return $this->updatedAt;
  79. //    }
  80. //    public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
  81. //    {
  82. //        $this->updatedAt = $updatedAt;
  83. //
  84. //        return $this;
  85. //    }
  86. //
  87. //    public function getCreatedAt(): ?\DateTimeInterface
  88. //    {
  89. //        return $this->createdAt;
  90. //    }
  91. //    public function setCreatedAt(?\DateTimeInterface $createdAt): self
  92. //    {
  93. //        $this->createdAt = $createdAt;
  94. //
  95. //        return $this;
  96. //    }
  97. }