src/Entity/CommentaireTicket.php line 10

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\CommentaireTicketRepository;
  4. use Doctrine\DBAL\Types\Types;
  5. use Doctrine\ORM\Mapping as ORM;
  6. #[ORM\Entity(repositoryClassCommentaireTicketRepository::class)]
  7. class CommentaireTicket
  8. {
  9.     #[ORM\Id]
  10.     #[ORM\GeneratedValue]
  11.     #[ORM\Column]
  12.     private ?int $id null;
  13.     #[ORM\ManyToOne(inversedBy'commentaires')]
  14.     #[ORM\JoinColumn(nullablefalse)]
  15.     private ?Ticket $ticket null;
  16.     #[ORM\Column(typeTypes::TEXT)]
  17.     private ?string $contenu null;
  18.     #[ORM\ManyToOne(targetEntityUser::class)]
  19.     #[ORM\JoinColumn(nullablefalse)]
  20.     private ?User $auteur null;
  21.     #[ORM\Column]
  22.     private ?\DateTimeImmutable $createdAt null;
  23.     #[ORM\Column(nullabletrue)]
  24.     private ?\DateTimeImmutable $updatedAt null;
  25.     #[ORM\Column]
  26.     private ?bool $estInterne false// Visible uniquement par l'équipe, pas par le client
  27.     public function __construct()
  28.     {
  29.         $this->createdAt = new \DateTimeImmutable();
  30.     }
  31.     public function getId(): ?int
  32.     {
  33.         return $this->id;
  34.     }
  35.     public function getTicket(): ?Ticket
  36.     {
  37.         return $this->ticket;
  38.     }
  39.     public function setTicket(?Ticket $ticket): static
  40.     {
  41.         $this->ticket $ticket;
  42.         return $this;
  43.     }
  44.     public function getContenu(): ?string
  45.     {
  46.         return $this->contenu;
  47.     }
  48.     public function setContenu(string $contenu): static
  49.     {
  50.         $this->contenu $contenu;
  51.         return $this;
  52.     }
  53.     public function getAuteur(): ?User
  54.     {
  55.         return $this->auteur;
  56.     }
  57.     public function setAuteur(?User $auteur): static
  58.     {
  59.         $this->auteur $auteur;
  60.         return $this;
  61.     }
  62.     public function getCreatedAt(): ?\DateTimeImmutable
  63.     {
  64.         return $this->createdAt;
  65.     }
  66.     public function setCreatedAt(\DateTimeImmutable $createdAt): static
  67.     {
  68.         $this->createdAt $createdAt;
  69.         return $this;
  70.     }
  71.     public function getUpdatedAt(): ?\DateTimeImmutable
  72.     {
  73.         return $this->updatedAt;
  74.     }
  75.     public function setUpdatedAt(?\DateTimeImmutable $updatedAt): static
  76.     {
  77.         $this->updatedAt $updatedAt;
  78.         return $this;
  79.     }
  80.     public function isEstInterne(): ?bool
  81.     {
  82.         return $this->estInterne;
  83.     }
  84.     public function setEstInterne(bool $estInterne): static
  85.     {
  86.         $this->estInterne $estInterne;
  87.         return $this;
  88.     }
  89.     public function __toString(): string
  90.     {
  91.         return substr($this->contenu ?? ''050) . '...';
  92.     }
  93. }