src/Entity/UnitaMisura.php line 19

  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\DBAL\Types\Types;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6.  * UnitaMisura
  7.  *
  8.  * @ORM\Table(name="unita_misura", indexes={
  9.  *     @ORM\Index(name="unita_misura_idx",
  10.  *     columns={
  11.  *      "codice"
  12.  *     })
  13.  * })
  14.  * @ORM\Entity(repositoryClass="App\Repository\UnitaMisuraRepository")
  15.  */
  16. class UnitaMisura
  17. {
  18.     /**
  19.      * @var string
  20.      *
  21.      * @ORM\Id
  22.      * @ORM\Column(name="codice", type="string", length=5, unique=true)
  23.      */
  24.     private $codice;
  25.     /**
  26.      * @var string
  27.      *
  28.      * @ORM\Column(name="descrizione", type="string", length=255, nullable=true)
  29.      */
  30.     private $descrizione;
  31.     /**
  32.      * @var string
  33.      *
  34.      * @ORM\Column(name="fattore_conversione", type="decimal", precision=28, scale=9)
  35.      */
  36.     private $fattoreConversione = 1;
  37.     /**
  38.      * @var int
  39.      *
  40.      * @ORM\Column(name="numero_decimali", type="integer")
  41.      */
  42.     private $numeroDecimali = 3;
  43.     /**
  44.      * @var \DateTime
  45.      *
  46.      * @ORM\Column(name="data_creazione", type="datetime", nullable=true)
  47.      */
  48.     private $dataCreazione;
  49.     /**
  50.      * @var \DateTime
  51.      *
  52.      * @ORM\Column(name="data_modifica", type="datetime", nullable=true)
  53.      */
  54.     private $dataModifica;
  55.     /**
  56.      * @var bool
  57.      *
  58.      * @ORM\Column(name="attivo", type="boolean")
  59.      */
  60.     private $attivo = true;
  61.     /**
  62.      * @ORM\ManyToOne(targetEntity="User")
  63.      * @ORM\JoinColumn(name="utente_id", referencedColumnName="id", onDelete="SET NULL")
  64.      */
  65.     private $utente;
  66.     /**
  67.      * Set codice
  68.      *
  69.      * @param string $codice
  70.      *
  71.      * @return UnitaMisura
  72.      */
  73.     public function setCodice($codice)
  74.     {
  75.         $this->codice = $codice;
  76.     
  77.         return $this;
  78.     }
  79.     public function getCodice(): ?string
  80.     {
  81.         return $this->codice;
  82.     }
  83.     public function setDescrizione(?string $descrizione): static
  84.     {
  85.         $this->descrizione = $descrizione;
  86.         return $this;
  87.     }
  88.     public function getDescrizione(): ?string
  89.     {
  90.         return $this->descrizione;
  91.     }
  92.     public function setFattoreConversione(string $fattoreConversione): static
  93.     {
  94.         $this->fattoreConversione = $fattoreConversione;
  95.         return $this;
  96.     }
  97.     public function getFattoreConversione(): ?string
  98.     {
  99.         return $this->fattoreConversione;
  100.     }
  101.     public function setNumeroDecimali(int $numeroDecimali): static
  102.     {
  103.         $this->numeroDecimali = $numeroDecimali;
  104.         return $this;
  105.     }
  106.     public function getNumeroDecimali(): ?int
  107.     {
  108.         return $this->numeroDecimali;
  109.     }
  110.     public function setDataCreazione(?\DateTimeInterface $dataCreazione): static
  111.     {
  112.         $this->dataCreazione = $dataCreazione;
  113.         return $this;
  114.     }
  115.     public function getDataCreazione(): ?\DateTimeInterface
  116.     {
  117.         return $this->dataCreazione;
  118.     }
  119.     public function setDataModifica(?\DateTimeInterface $dataModifica): static
  120.     {
  121.         $this->dataModifica = $dataModifica;
  122.         return $this;
  123.     }
  124.     public function getDataModifica(): ?\DateTimeInterface
  125.     {
  126.         return $this->dataModifica;
  127.     }
  128.     public function setAttivo(bool $attivo): static
  129.     {
  130.         $this->attivo = $attivo;
  131.         return $this;
  132.     }
  133.     public function getAttivo(): ?bool
  134.     {
  135.         return $this->attivo;
  136.     }
  137.     public function setUtente(?User $utente): static
  138.     {
  139.         $this->utente = $utente;
  140.         return $this;
  141.     }
  142.     public function getUtente(): ?User
  143.     {
  144.         return $this->utente;
  145.     }
  146.     public function isAttivo(): ?bool
  147.     {
  148.         return $this->attivo;
  149.     }
  150. }