<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Security\Core\Security;
use App\Validator as AppAssert;
use App\Entity\User;
use App\Entity\Azienda;
// idx_decode_decname
/**
* @ORM\Entity(repositoryClass="App\Repository\DecodeRepository")
* @ORM\Table(indexes={@ORM\Index(name="idx_decode_decname", columns={"decname"})}, uniqueConstraints={@ORM\UniqueConstraint(name="uqe_decode_per_macchina", columns={"decclass", "deckey", "decmacchina_id"})})
* @AppAssert\UniqueDecodeKey
*/
class Decode
{
/**
* @ORM\Id()
* @ORM\Column(type="string", length=100)
*/
private $DECClass;
/**
* @ORM\Id()
* @ORM\Column(type="string", length=100)
*/
private $DECKey;
/**
* @ORM\Column(type="text")
*/
private $DECValue;
/**
* @ORM\Column(type="string", length=1)
*/
private $DECType;
/**
* @ORM\Column(type="string", length=400, nullable=true)
*/
private $DECDescription;
/**
* @ORM\Column(type="smallint")
*/
private $DECActive;
/**
* @ORM\Column(type="smallint")
*/
private $DECOrder;
/**
* @ORM\Column(type="integer", options={"default" : 0})
*/
private $DECAziendaId;
protected $m_CurAzienda;
protected $m_CurUser;
/**
* @ORM\Column(type="string", length=4096, nullable=true)
*/
private $DECValidValues;
/**
* @ORM\Column(type="string", length=100, nullable=true)
*/
private $Gruppo;
/**
* @ORM\Column(type="string", length=2048, nullable=true)
*/
private $Cmd;
/**
* @ORM\Column(type="integer", options={"default" : 0})
*/
private $DECUtenteId;
/**
* @ORM\Id()
* @ORM\Column(type="integer")
*/
private $DECMacchinaId;
/**
* @ORM\Column(type="integer")
*/
private $CreatorId;
/**
* @ORM\Column(type="datetime", options={"default" : "2000-01-01 00:00:00"})
*/
private $CreationDate;
/**
* @ORM\Column(type="integer")
*/
private $ModifyId;
/**
* @ORM\Column(type="datetime", options={"default" : "2000-01-01 00:00:00"})
*/
private $ModifyDate;
/**
* @ORM\Column(name="decname", type="string", length=200)
*/
private $DecName;
/**
* @ORM\Column(name="deceditor", type="integer")
*/
private $DECEditor;
/**
* @ORM\Column(name="decimmagine", type="string", length=255, nullable=true)
*/
private $DECImmagine;
/**
* @ORM\Column(name="decsezione", type="string", length=255, nullable=true)
*/
private $DECSezione;
/**
* @ORM\Column(name="decsezione_ordinamento", type="integer", nullable=true)
*/
private $DECSezioneOrdinamento;
/**
* @ORM\Column(name="decdesc_extended", type="string", length=2048, nullable=true)
*/
private $DECDescExtended;
public function __construct(Security $security = null, User $a_User = null)
{
if (!empty($security)) {
$this->m_CurUser = $security->getUser();
}
else {
$this->m_CurUser = $a_User;
}
$this->m_CurAzienda = null;
$this->DECAziendaId = 0;
$this->DECUtenteId = 0;
$this->DECEditor = 0; // Valore di default
if (!empty($this->m_CurUser)) {
$this->DECUtenteId = $this->m_CurUser->getId();
$this->m_CurAzienda = $this->m_CurUser->getAzienda();
if (!empty($this->m_CurAzienda)) {
$this->DECAziendaId = $this->m_CurAzienda->getId();
}
}
}
public function getDECClass(): ?string
{
return $this->DECClass;
}
public function setDECClass(string $DECClass): self
{
$this->DECClass = $DECClass;
return $this;
}
public function getDECKey(): ?string
{
return $this->DECKey;
}
public function setDECKey(string $DECKey): self
{
$this->DECKey = $DECKey;
return $this;
}
public function getDECValue(): ?string
{
return $this->DECValue;
}
public function setDECValue(string $DECValue): self
{
$this->DECValue = $DECValue;
return $this;
}
public function getDECType(): ?string
{
return $this->DECType;
}
public function setDECType(string $DECType): self
{
$this->DECType = $DECType;
return $this;
}
public function getDECDescription(): ?string
{
return $this->DECDescription;
}
public function setDECDescription(?string $DECDescription): self
{
$this->DECDescription = $DECDescription;
return $this;
}
public function getDECActive(): ?int
{
return $this->DECActive;
}
public function setDECActive(int $DECActive): self
{
$this->DECActive = $DECActive;
return $this;
}
public function getDECOrder(): ?int
{
return $this->DECOrder;
}
public function setDECOrder(int $DECOrder): self
{
$this->DECOrder = $DECOrder;
return $this;
}
public function getDECAziendaId(): ?int
{
return $this->DECAziendaId;
}
public function setDECAziendaId(int $DECAziendaId): self
{
$this->DECAziendaId = $DECAziendaId;
return $this;
}
public function getDECUtenteId(): ?int
{
return $this->DECUtenteId;
}
public function setDECUtenteId(int $DECUtenteId): self
{
$this->DECUtenteId = $DECUtenteId;
return $this;
}
public function getDECValidValues(): ?string
{
return $this->DECValidValues;
}
public function setDECValidValues(?string $DECValidValues): self
{
$this->DECValidValues = $DECValidValues;
return $this;
}
public function getGruppo(): ?string
{
return $this->Gruppo;
}
public function setGruppo(?string $Gruppo): self
{
$this->Gruppo = $Gruppo;
return $this;
}
public function getCmd(): ?string
{
return $this->Cmd;
}
public function setCmd(?string $Cmd): self
{
$this->Cmd = $Cmd;
return $this;
}
public function getDECMacchinaId(): ?int
{
return $this->DECMacchinaId;
}
public function setDECMacchinaId(int $DECMacchinaId): self
{
$this->DECMacchinaId = $DECMacchinaId;
return $this;
}
public function getCreatorId(): ?int
{
return $this->CreatorId;
}
public function setCreatorId(int $CreatorId): self
{
$this->CreatorId = $CreatorId;
return $this;
}
public function getCreationDate(): ?\DateTimeInterface
{
return $this->CreationDate;
}
public function setCreationDate(\DateTimeInterface $CreationDate): self
{
$this->CreationDate = $CreationDate;
return $this;
}
public function getModifyId(): ?int
{
return $this->ModifyId;
}
public function setModifyId(int $ModifyId): self
{
$this->ModifyId = $ModifyId;
return $this;
}
public function getModifyDate(): ?\DateTimeInterface
{
return $this->ModifyDate;
}
public function setModifyDate(\DateTimeInterface $ModifyDate): self
{
$this->ModifyDate = $ModifyDate;
return $this;
}
public function getDecName(): ?string
{
return $this->DecName;
}
public function setDecName(string $DecName): self
{
$this->DecName = $DecName;
return $this;
}
public function getDECEditor(): ?int
{
return $this->DECEditor;
}
public function setDECEditor(int $DECEditor): self
{
$this->DECEditor = $DECEditor;
return $this;
}
public function getDECImmagine(): ?string
{
return $this->DECImmagine;
}
public function setDECImmagine(?string $DECImmagine): self
{
$this->DECImmagine = $DECImmagine;
return $this;
}
public function getDECSezione(): ?string
{
return $this->DECSezione;
}
public function setDECSezione(?string $DECSezione): self
{
$this->DECSezione = $DECSezione;
return $this;
}
public function getDECSezioneOrdinamento(): ?int
{
return $this->DECSezioneOrdinamento;
}
public function setDECSezioneOrdinamento(?int $DECSezioneOrdinamento): self
{
$this->DECSezioneOrdinamento = $DECSezioneOrdinamento;
return $this;
}
public function getDECDescExtended(): ?string
{
return $this->DECDescExtended;
}
public function setDECDescExtended(?string $DECDescExtended): self
{
$this->DECDescExtended = $DECDescExtended;
return $this;
}
}