src/Entity/Ticket.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7.  * @ORM\Entity(repositoryClass="App\Repository\TicketRepository")
  8.  * @ORM\Table(name="tickets", indexes={@ORM\Index(name="id_index", columns={"id"})})
  9.  */
  10. class Ticket
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\Column(type="integer")
  15.      * @ORM\GeneratedValue(strategy="AUTO")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="datetime", nullable=false)
  20.      */
  21.     private $create_date;
  22.     /**
  23.      * @ORM\Column(type="string", length=10, nullable=false)
  24.      */
  25.     private $code;
  26.     /**
  27.      * @ORM\Column(type="string", length=250, nullable=false)
  28.      */
  29.     private $subject;
  30.     /**
  31.      * @ORM\Column(type="text", nullable=false)
  32.      */
  33.     private $message;
  34.     /**
  35.      * @ORM\Column(type="string", length=10, nullable=false)
  36.      */
  37.     private $status;
  38.     /**
  39.      * @ORM\OneToMany(targetEntity="App\Entity\TicketReply", mappedBy="ticket")
  40.      */
  41.     private $ticketReplies;
  42.     /**
  43.      * @ORM\ManyToOne(targetEntity="App\Entity\User", inversedBy="tickets")
  44.      * @ORM\JoinColumn(name="user_id", referencedColumnName="id", nullable=false)
  45.      */
  46.     private $user;
  47.     public function __construct()
  48.     {
  49.         $this->ticketReplies = new ArrayCollection();
  50.     }
  51.     public function getId(): ?int
  52.     {
  53.         return $this->id;
  54.     }
  55.     public function getCreateDate(): ?\DateTimeInterface
  56.     {
  57.         return $this->create_date;
  58.     }
  59.     public function setCreateDate(\DateTimeInterface $create_date): self
  60.     {
  61.         $this->create_date $create_date;
  62.         return $this;
  63.     }
  64.     public function getCode(): ?string
  65.     {
  66.         return $this->code;
  67.     }
  68.     public function setCode(string $code): self
  69.     {
  70.         $this->code $code;
  71.         return $this;
  72.     }
  73.     public function getSubject(): ?string
  74.     {
  75.         return $this->subject;
  76.     }
  77.     public function setSubject(string $subject): self
  78.     {
  79.         $this->subject $subject;
  80.         return $this;
  81.     }
  82.     public function getMessage(): ?string
  83.     {
  84.         return $this->message;
  85.     }
  86.     public function setMessage(string $message): self
  87.     {
  88.         $this->message $message;
  89.         return $this;
  90.     }
  91.     public function getStatus(): ?string
  92.     {
  93.         return $this->status;
  94.     }
  95.     public function setStatus(string $status): self
  96.     {
  97.         $this->status $status;
  98.         return $this;
  99.     }
  100.     /**
  101.      * @return Collection|TicketReply[]
  102.      */
  103.     public function getTicketReplies(): Collection
  104.     {
  105.         return $this->ticketReplies;
  106.     }
  107.     public function addTicketReply(TicketReply $ticketReply): self
  108.     {
  109.         if (!$this->ticketReplies->contains($ticketReply)) {
  110.             $this->ticketReplies[] = $ticketReply;
  111.             $ticketReply->setTicket($this);
  112.         }
  113.         return $this;
  114.     }
  115.     public function removeTicketReply(TicketReply $ticketReply): self
  116.     {
  117.         if ($this->ticketReplies->removeElement($ticketReply)) {
  118.             // set the owning side to null (unless already changed)
  119.             if ($ticketReply->getTicket() === $this) {
  120.                 $ticketReply->setTicket(null);
  121.             }
  122.         }
  123.         return $this;
  124.     }
  125.     public function getUser(): ?User
  126.     {
  127.         return $this->user;
  128.     }
  129.     public function setUser(?User $user): self
  130.     {
  131.         $this->user $user;
  132.         return $this;
  133.     }
  134. }