<?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_log")
* @ORM\Entity(repositoryClass="App\Repository\Slave\LogRepository")
*/
class TicketLog
{
public function getDisplayDetails()
{
switch($this->getAction()){
case 'cs':
return "L'utente <strong>".$this->getOperator()."</strong> ha modificato lo stato del ticket da <strong>".$this->getOldValue()."</strong> a <strong>".$this->getNewValue()."</strong>";
case 'ct':
return "L'utente <strong>".$this->getOperator()."</strong> ha modificato il tecnico assegnato al ticket da <strong>".$this->getOldValue()."</strong> a <strong>".$this->getNewValue()."</strong>";
default:
return '';
}
}
/**
* @ORM\Column(name="id", type="bigint")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @ORM\Column(name="datetime", type="datetime")
*/
protected $datetime;
/**
* @ORM\Column(name="action", type="string", length=191)
*/
protected $action;
/**
* @ORM\Column(name="operator", type="string", length=191)
*/
protected $operator;
/**
* @ORM\Column(name="old_value", type="string", length=191)
*/
protected $oldValue;
/**
* @ORM\Column(name="new_value", type="string", length=191)
*/
protected $newValue;
// ManyToOne
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Slave\Ticket", inversedBy="logs")
* @ORM\JoinColumn(name="ticket_id", referencedColumnName="id")
*/
private $ticket;
//
public function getId(): ?string
{
return $this->id;
}
public function getDatetime(): ?\DateTimeInterface
{
return $this->datetime;
}
public function setDatetime(\DateTimeInterface $datetime): static
{
$this->datetime = $datetime;
return $this;
}
public function getAction(): ?string
{
return $this->action;
}
public function setAction(string $action): static
{
$this->action = $action;
return $this;
}
public function getOperator(): ?string
{
return $this->operator;
}
public function setOperator(string $operator): static
{
$this->operator = $operator;
return $this;
}
public function getOldValue(): ?string
{
return $this->oldValue;
}
public function setOldValue(string $oldValue): static
{
$this->oldValue = $oldValue;
return $this;
}
public function getNewValue(): ?string
{
return $this->newValue;
}
public function setNewValue(string $newValue): static
{
$this->newValue = $newValue;
return $this;
}
public function getTicket(): ?Ticket
{
return $this->ticket;
}
public function setTicket(?Ticket $ticket): static
{
$this->ticket = $ticket;
return $this;
}
}