<?php
namespace App\Entity\Slave;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Table(name="eposm_s_ticket_status")
* @ORM\Entity(repositoryClass="App\Repository\Slave\TicketStatusRepository")
*/
class TicketStatus
{
/**
* @ORM\Column(name="id", type="bigint")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @ORM\Column(name="slug", type="string", length=191, unique=true)
*/
protected $slug;
/**
* @ORM\Column(name="value", type="string", length=191)
*/
protected $value;
// OneToMany
/**
* @ORM\OneToMany(targetEntity="App\Entity\Slave\Ticket", mappedBy="status")
*/
private $tickets;
//
public function __construct()
{
$this->tickets = new ArrayCollection();
}
public function getId(): ?string
{
return $this->id;
}
public function getSlug(): ?string
{
return $this->slug;
}
public function setSlug(string $slug): self
{
$this->slug = $slug;
return $this;
}
public function getValue(): ?string
{
return $this->value;
}
public function setValue(string $value): self
{
$this->value = $value;
return $this;
}
/**
* @return Collection<int, Ticket>
*/
public function getTickets(): Collection
{
return $this->tickets;
}
public function addTicket(Ticket $ticket): self
{
if (!$this->tickets->contains($ticket)) {
$this->tickets->add($ticket);
$ticket->setTickets($this);
}
return $this;
}
public function removeTicket(Ticket $ticket): self
{
if ($this->tickets->removeElement($ticket)) {
// set the owning side to null (unless already changed)
if ($ticket->getTickets() === $this) {
$ticket->setTickets(null);
}
}
return $this;
}
}