src/Entity/Ticket.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\Trait\isActif;
  4. use App\Repository\TicketRepository;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7.  * @ORM\Entity(repositoryClass=TicketRepository::class)
  8.  * @ORM\HasLifecycleCallbacks()
  9.  */
  10. class Ticket
  11. {
  12.     use isActif;
  13.     /**
  14.      * @ORM\Id
  15.      * @ORM\GeneratedValue
  16.      * @ORM\Column(type="integer")
  17.      */
  18.     private $id;
  19.     /**
  20.      * @ORM\Column(type="string", length=255)
  21.      */
  22.     private $subject;
  23.     /**
  24.      * @ORM\Column(type="string", length=255)
  25.      */
  26.     private $typeOfRequest;
  27.     /**
  28.      * @ORM\Column(type="text")
  29.      */
  30.     private $message;
  31.     /**
  32.      * @ORM\ManyToOne(targetEntity=Enterprise::class, inversedBy="tickets")
  33.      */
  34.     private $enterprise;
  35.     /**
  36.      * @ORM\ManyToOne(targetEntity=Provider::class, inversedBy="tickets")
  37.      */
  38.     private $provider;
  39.     /**
  40.      * @ORM\Column(type="datetime_immutable")
  41.      */
  42.     private $date;
  43.     /**
  44.      * @ORM\ManyToOne(targetEntity=Contract::class, inversedBy="tickets")
  45.      */
  46.     private $contract;
  47.     /**
  48.      * @ORM\Column(type="string", length=255, unique=true)
  49.      */
  50.     private $slug;
  51.     public function getId(): ?int
  52.     {
  53.         return $this->id;
  54.     }
  55.     public function getSubject(): ?string
  56.     {
  57.         return $this->subject;
  58.     }
  59.     public function setSubject(string $subject): self
  60.     {
  61.         $this->subject $subject;
  62.         return $this;
  63.     }
  64.     public function getTypeOfRequest(): ?string
  65.     {
  66.         return $this->typeOfRequest;
  67.     }
  68.     public function setTypeOfRequest(string $typeOfRequest): self
  69.     {
  70.         $this->typeOfRequest $typeOfRequest;
  71.         return $this;
  72.     }
  73.     public function getMessage(): ?string
  74.     {
  75.         return $this->message;
  76.     }
  77.     public function setMessage(string $message): self
  78.     {
  79.         $this->message $message;
  80.         return $this;
  81.     }
  82.     public function getEnterprise(): ?Enterprise
  83.     {
  84.         return $this->enterprise;
  85.     }
  86.     public function setEnterprise(?Enterprise $enterprise): self
  87.     {
  88.         $this->enterprise $enterprise;
  89.         return $this;
  90.     }
  91.     public function getProvider(): ?Provider
  92.     {
  93.         return $this->provider;
  94.     }
  95.     public function setProvider(?Provider $provider): self
  96.     {
  97.         $this->provider $provider;
  98.         return $this;
  99.     }
  100.     public function getDate(): ?\DateTimeImmutable
  101.     {
  102.         return $this->date;
  103.     }
  104.     public function setDate(\DateTimeImmutable $date): self
  105.     {
  106.         $this->date $date;
  107.         return $this;
  108.     }
  109.     public function getContract(): ?Contract
  110.     {
  111.         return $this->contract;
  112.     }
  113.     public function setContract(?Contract $contract): self
  114.     {
  115.         $this->contract $contract;
  116.         return $this;
  117.     }
  118.     public function getSlug(): ?string
  119.     {
  120.         return $this->slug;
  121.     }
  122.     public function setSlug(string $slug): self
  123.     {
  124.         $this->slug $slug;
  125.         return $this;
  126.     }
  127.     /**
  128.      * @ORM\PrePersist
  129.      */
  130.     public function setDateValue(): void
  131.     {
  132.         $this->date = new \DateTimeImmutable();
  133.     }
  134. }