src/Entity/Slave/TicketStatus.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Slave;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\DBAL\Types\Types;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Table(name="eposm_s_ticket_status")
  9.  * @ORM\Entity(repositoryClass="App\Repository\Slave\TicketStatusRepository")
  10.  */
  11. class TicketStatus
  12. {        
  13.     /**
  14.      * @ORM\Column(name="id", type="bigint")
  15.      * @ORM\Id
  16.      * @ORM\GeneratedValue(strategy="AUTO")
  17.      */
  18.     protected $id;
  19.     
  20.     /**
  21.      * @ORM\Column(name="slug", type="string", length=191, unique=true)
  22.      */
  23.     protected $slug;
  24.     
  25.     /**
  26.      * @ORM\Column(name="value", type="string", length=191)
  27.      */
  28.     protected $value;
  29.     // OneToMany
  30.         /**
  31.          * @ORM\OneToMany(targetEntity="App\Entity\Slave\Ticket", mappedBy="status")
  32.          */
  33.         private $tickets;
  34.     //
  35.     public function __construct()
  36.     {
  37.         $this->tickets = new ArrayCollection();
  38.     }
  39.     public function getId(): ?string
  40.     {
  41.         return $this->id;
  42.     }
  43.     public function getSlug(): ?string
  44.     {
  45.         return $this->slug;
  46.     }
  47.     public function setSlug(string $slug): self
  48.     {
  49.         $this->slug $slug;
  50.         return $this;
  51.     }
  52.     public function getValue(): ?string
  53.     {
  54.         return $this->value;
  55.     }
  56.     public function setValue(string $value): self
  57.     {
  58.         $this->value $value;
  59.         return $this;
  60.     }
  61.     /**
  62.      * @return Collection<int, Ticket>
  63.      */
  64.     public function getTickets(): Collection
  65.     {
  66.         return $this->tickets;
  67.     }
  68.     public function addTicket(Ticket $ticket): self
  69.     {
  70.         if (!$this->tickets->contains($ticket)) {
  71.             $this->tickets->add($ticket);
  72.             $ticket->setTickets($this);
  73.         }
  74.         return $this;
  75.     }
  76.     public function removeTicket(Ticket $ticket): self
  77.     {
  78.         if ($this->tickets->removeElement($ticket)) {
  79.             // set the owning side to null (unless already changed)
  80.             if ($ticket->getTickets() === $this) {
  81.                 $ticket->setTickets(null);
  82.             }
  83.         }
  84.         return $this;
  85.     }
  86. }