src/Entity/Complain.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ComplainRepository;
  4. use Doctrine\DBAL\Types\Types;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Doctrine\ORM\Mapping\HasLifecycleCallbacks;
  7. #[ORM\Entity(repositoryClassComplainRepository::class)]
  8. #[HasLifecycleCallbacks]
  9. class Complain
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column]
  14.     private ?int $id null;
  15.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  16.     private ?string $body null;
  17.     #[ORM\Column(length50nullabletrue)]
  18.     private ?string $author null;
  19.     #[ORM\Column(length25nullabletrue)]
  20.     private ?string $type null;
  21.     #[ORM\Column]
  22.     private ?\DateTimeImmutable $createdAt null;
  23.     #[ORM\Column]
  24.     private ?\DateTimeImmutable $updatedAt null;
  25.     public function getCreatedAt(): ?\DateTimeImmutable
  26.     {
  27.         return $this->createdAt;
  28.     }
  29.     public function setCreatedAt(\DateTimeImmutable $createdAt): self
  30.     {
  31.         $this->createdAt $createdAt;
  32.         return $this;
  33.     }
  34.     public function getUpdatedAt(): ?\DateTimeImmutable
  35.     {
  36.         return $this->updatedAt;
  37.     }
  38.     public function setUpdatedAt(\DateTimeImmutable $updatedAt): self
  39.     {
  40.         $this->updatedAt $updatedAt;
  41.         return $this;
  42.     }
  43.     #[ORM\PrePersist]
  44.     public function setCreatedAtValue(): void
  45.     {
  46.         $this->createdAt = new \DateTimeImmutable();
  47.         $this->setUpdatedAtValue();
  48.     }
  49.     #[ORM\PreUpdate]
  50.     public function setUpdatedAtValue(): void
  51.     {
  52.         $this->updatedAt = new \DateTimeImmutable();
  53.     }
  54.     public function getId(): ?int
  55.     {
  56.         return $this->id;
  57.     }
  58.     public function getBody(): ?string
  59.     {
  60.         return $this->body;
  61.     }
  62.     public function setBody(?string $body): static
  63.     {
  64.         $this->body $body;
  65.         return $this;
  66.     }
  67.     public function getAuthor(): ?string
  68.     {
  69.         return $this->author;
  70.     }
  71.     public function setAuthor(?string $author): static
  72.     {
  73.         $this->author $author;
  74.         return $this;
  75.     }
  76.     public function getType(): ?string
  77.     {
  78.         return $this->type;
  79.     }
  80.     public function setType(?string $type): static
  81.     {
  82.         $this->type $type;
  83.         return $this;
  84.     }
  85. }