src/Entity/Slave/TicketLog.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_log")
  9.  * @ORM\Entity(repositoryClass="App\Repository\Slave\LogRepository")
  10.  */
  11. class TicketLog
  12. {       
  13.     
  14.     public function getDisplayDetails()
  15.     {
  16.         switch($this->getAction()){
  17.             case 'cs':
  18.                 return "L'utente <strong>".$this->getOperator()."</strong> ha modificato lo stato del ticket da <strong>".$this->getOldValue()."</strong> a <strong>".$this->getNewValue()."</strong>";
  19.             case 'ct':
  20.                 return "L'utente <strong>".$this->getOperator()."</strong> ha modificato il tecnico assegnato al ticket da <strong>".$this->getOldValue()."</strong> a <strong>".$this->getNewValue()."</strong>";
  21.             default:
  22.                 return '';
  23.         }
  24.     }
  25.     /**
  26.      * @ORM\Column(name="id", type="bigint")
  27.      * @ORM\Id
  28.      * @ORM\GeneratedValue(strategy="AUTO")
  29.      */
  30.     protected $id;
  31.     /**
  32.      * @ORM\Column(name="datetime", type="datetime")
  33.      */
  34.     protected $datetime;
  35.     
  36.     /**
  37.      * @ORM\Column(name="action", type="string", length=191)
  38.      */
  39.     protected $action;
  40.     
  41.     /**
  42.      * @ORM\Column(name="operator", type="string", length=191)
  43.      */
  44.     protected $operator;
  45.     
  46.     /**
  47.      * @ORM\Column(name="old_value", type="string", length=191)
  48.      */
  49.     protected $oldValue;
  50.     
  51.     /**
  52.      * @ORM\Column(name="new_value", type="string", length=191)
  53.      */
  54.     protected $newValue;
  55.     // ManyToOne
  56.         /**
  57.          * @ORM\ManyToOne(targetEntity="App\Entity\Slave\Ticket", inversedBy="logs")
  58.          * @ORM\JoinColumn(name="ticket_id", referencedColumnName="id")
  59.          */
  60.         private $ticket;        
  61.     //
  62.     public function getId(): ?string
  63.     {
  64.         return $this->id;
  65.     }
  66.     public function getDatetime(): ?\DateTimeInterface
  67.     {
  68.         return $this->datetime;
  69.     }
  70.     public function setDatetime(\DateTimeInterface $datetime): static
  71.     {
  72.         $this->datetime $datetime;
  73.         return $this;
  74.     }
  75.     public function getAction(): ?string
  76.     {
  77.         return $this->action;
  78.     }
  79.     public function setAction(string $action): static
  80.     {
  81.         $this->action $action;
  82.         return $this;
  83.     }
  84.     public function getOperator(): ?string
  85.     {
  86.         return $this->operator;
  87.     }
  88.     public function setOperator(string $operator): static
  89.     {
  90.         $this->operator $operator;
  91.         return $this;
  92.     }
  93.     public function getOldValue(): ?string
  94.     {
  95.         return $this->oldValue;
  96.     }
  97.     public function setOldValue(string $oldValue): static
  98.     {
  99.         $this->oldValue $oldValue;
  100.         return $this;
  101.     }
  102.     public function getNewValue(): ?string
  103.     {
  104.         return $this->newValue;
  105.     }
  106.     public function setNewValue(string $newValue): static
  107.     {
  108.         $this->newValue $newValue;
  109.         return $this;
  110.     }
  111.     public function getTicket(): ?Ticket
  112.     {
  113.         return $this->ticket;
  114.     }
  115.     public function setTicket(?Ticket $ticket): static
  116.     {
  117.         $this->ticket $ticket;
  118.         return $this;
  119.     }
  120. }