src/Entity/Slave/ProductLog.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_product_log")
  9.  * @ORM\Entity(repositoryClass="App\Repository\Slave\ProductLogRepository")
  10.  */
  11. class ProductLog
  12. {       
  13.     public function displayHtml(){
  14.         $html '<table class="table table_no_padding b_none m_b_none"><tr><th class="td_w_70p">Utente</th><td>'.$this->getOperator().'</td></tr><tr><th>Prodotto</th><td>'.$this->getModel();
  15.         if($this->getCodeProducer() != null$html.= ' --- Matricola produttore: '.$this->getCodeProducer();
  16.         if($this->getCodeSupplier() != null$html.= ' --- Matricola produttore: '.$this->getCodeSupplier();
  17.         $html.= '</td></tr><tr><th>Modifica a</th><td>';
  18.         switch($this->getType()){
  19.             case 'status'$html.= 'Stato'; break;
  20.             case 'condition'$html.= 'Condizione'; break;
  21.             case 'code-producer'$html.= 'Matricola produttore'; break;
  22.             case 'code-supplier'$html.= 'Matricola fornitore'; break;
  23.             default: break;
  24.         }
  25.         $html.= '</td><tr><th>Da</th><td>'.$this->getOldValue().'</td></tr><tr><th>A</th><td>'.$this->getNewValue().'</td></th></tr></table>';
  26.         return $html;
  27.     }
  28.     
  29.     /**
  30.      * @ORM\Column(name="id", type="bigint")
  31.      * @ORM\Id
  32.      * @ORM\GeneratedValue(strategy="AUTO")
  33.      */
  34.     protected $id;
  35.        
  36.     /**
  37.      * @ORM\Column(name="text", type="text", nullable=true)
  38.      */
  39.     protected $text;
  40.     /**
  41.      * @ORM\Column(name="datetime", type="datetime")
  42.      */
  43.     protected $datetime;
  44.     
  45.     /**
  46.      * @ORM\Column(name="operator", type="string", length=191)
  47.      */
  48.     protected $operator;
  49.     
  50.     /**
  51.      * @ORM\Column(name="model", type="string", length=191)
  52.      */
  53.     protected $model;
  54.     
  55.     /**
  56.      * @ORM\Column(name="code_producer", type="string", length=191, nullable=true)
  57.      */
  58.     protected $codeProducer;
  59.     
  60.     /**
  61.      * @ORM\Column(name="code_supplier", type="string", length=191, nullable=true)
  62.      */
  63.     protected $codeSupplier;
  64.     
  65.     /**
  66.      * @ORM\Column(name="type", type="string", length=191)
  67.      */
  68.     protected $type;
  69.     
  70.     /**
  71.      * @ORM\Column(name="old_value", type="string", length=191)
  72.      */
  73.     protected $oldValue;
  74.     
  75.     /**
  76.      * @ORM\Column(name="new_value", type="string", length=191)
  77.      */
  78.     protected $newValue;
  79.     
  80.     /**
  81.      * @ORM\Column(name="old_data_id", type="string", length=191, nullable=true)
  82.      */
  83.     protected $oldDataId;
  84.     // ManyToOne
  85.         /**
  86.          * @ORM\ManyToOne(targetEntity="App\Entity\Slave\Product", inversedBy="logs")
  87.          * @ORM\JoinColumn(name="product_id", referencedColumnName="id")
  88.          */
  89.         private $product;
  90.         /**
  91.          * @ORM\ManyToOne(targetEntity="App\Entity\Slave\User", inversedBy="productLogs")
  92.          * @ORM\JoinColumn(name="user_id", referencedColumnName="id")
  93.          */
  94.         private $user;
  95.         
  96.         /**
  97.          * @ORM\ManyToOne(targetEntity="App\Entity\Slave\Intervention", inversedBy="productLogs")
  98.          * @ORM\JoinColumn(name="intervention_id", referencedColumnName="id")
  99.          */
  100.         private $intervention;
  101.     //
  102.     public function getId(): ?string
  103.     {
  104.         return $this->id;
  105.     }
  106.     public function getText(): ?string
  107.     {
  108.         return $this->text;
  109.     }
  110.     public function setText(?string $text): static
  111.     {
  112.         $this->text $text;
  113.         return $this;
  114.     }
  115.     public function getDatetime(): ?\DateTimeInterface
  116.     {
  117.         return $this->datetime;
  118.     }
  119.     public function setDatetime(\DateTimeInterface $datetime): static
  120.     {
  121.         $this->datetime $datetime;
  122.         return $this;
  123.     }
  124.     public function getOperator(): ?string
  125.     {
  126.         return $this->operator;
  127.     }
  128.     public function setOperator(string $operator): static
  129.     {
  130.         $this->operator $operator;
  131.         return $this;
  132.     }
  133.     public function getModel(): ?string
  134.     {
  135.         return $this->model;
  136.     }
  137.     public function setModel(string $model): static
  138.     {
  139.         $this->model $model;
  140.         return $this;
  141.     }
  142.     public function getCodeProducer(): ?string
  143.     {
  144.         return $this->codeProducer;
  145.     }
  146.     public function setCodeProducer(?string $codeProducer): static
  147.     {
  148.         $this->codeProducer $codeProducer;
  149.         return $this;
  150.     }
  151.     public function getCodeSupplier(): ?string
  152.     {
  153.         return $this->codeSupplier;
  154.     }
  155.     public function setCodeSupplier(?string $codeSupplier): static
  156.     {
  157.         $this->codeSupplier $codeSupplier;
  158.         return $this;
  159.     }
  160.     public function getType(): ?string
  161.     {
  162.         return $this->type;
  163.     }
  164.     public function setType(string $type): static
  165.     {
  166.         $this->type $type;
  167.         return $this;
  168.     }
  169.     public function getOldValue(): ?string
  170.     {
  171.         return $this->oldValue;
  172.     }
  173.     public function setOldValue(string $oldValue): static
  174.     {
  175.         $this->oldValue $oldValue;
  176.         return $this;
  177.     }
  178.     public function getNewValue(): ?string
  179.     {
  180.         return $this->newValue;
  181.     }
  182.     public function setNewValue(string $newValue): static
  183.     {
  184.         $this->newValue $newValue;
  185.         return $this;
  186.     }
  187.     public function getOldDataId(): ?string
  188.     {
  189.         return $this->oldDataId;
  190.     }
  191.     public function setOldDataId(?string $oldDataId): static
  192.     {
  193.         $this->oldDataId $oldDataId;
  194.         return $this;
  195.     }
  196.     public function getProduct(): ?Product
  197.     {
  198.         return $this->product;
  199.     }
  200.     public function setProduct(?Product $product): static
  201.     {
  202.         $this->product $product;
  203.         return $this;
  204.     }
  205.     public function getUser(): ?User
  206.     {
  207.         return $this->user;
  208.     }
  209.     public function setUser(?User $user): static
  210.     {
  211.         $this->user $user;
  212.         return $this;
  213.     }
  214.     public function getIntervention(): ?Intervention
  215.     {
  216.         return $this->intervention;
  217.     }
  218.     public function setIntervention(?Intervention $intervention): static
  219.     {
  220.         $this->intervention $intervention;
  221.         return $this;
  222.     }
  223. }