init project
This commit is contained in:
188
src/Entity/SoftwareActivation.php
Normal file
188
src/Entity/SoftwareActivation.php
Normal file
@@ -0,0 +1,188 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Repository\SoftwareActivationRepository;
|
||||
use Doctrine\DBAL\Types\Types;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use PhpParser\Node\Expr\Cast\String_;
|
||||
|
||||
#[ORM\Entity(repositoryClass: SoftwareActivationRepository::class)]
|
||||
class SoftwareActivation
|
||||
{
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column]
|
||||
private ?int $id = null;
|
||||
|
||||
#[ORM\Column(length: 255)]
|
||||
private ?string $companyName = null;
|
||||
|
||||
#[ORM\Column(length: 400)]
|
||||
private ?string $companyMF = null;
|
||||
|
||||
#[ORM\Column(length: 255)]
|
||||
private ?string $PcName = null;
|
||||
|
||||
#[ORM\ManyToOne(inversedBy: 'softwareActivations')]
|
||||
private ?User $user = null;
|
||||
|
||||
#[ORM\Column(length: 255)]
|
||||
private ?string $disqueNom = null;
|
||||
|
||||
#[ORM\Column(length: 300)]
|
||||
private ?string $disqueModel = null;
|
||||
|
||||
#[ORM\Column(length: 350)]
|
||||
private ?string $disqueSerial = null;
|
||||
|
||||
#[ORM\Column(type: Types::DATETIME_MUTABLE)]
|
||||
private ?\DateTimeInterface $dateAdd = null;
|
||||
|
||||
/*
|
||||
pour le code
|
||||
0 | null --> n'ai pas encore activer
|
||||
1 --> activer
|
||||
2 --> La demande a été bien envoyer pour activé le logiciel
|
||||
n --> erreur
|
||||
*/
|
||||
#[ORM\Column(type: Types::SMALLINT)]
|
||||
private ?int $statu = null;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->dateAdd = new \DateTime();
|
||||
}
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getCompanyName(): ?string
|
||||
{
|
||||
return $this->companyName;
|
||||
}
|
||||
|
||||
public function setCompanyName(string $companyName): static
|
||||
{
|
||||
$this->companyName = $companyName;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getCompanyMF(): ?string
|
||||
{
|
||||
return $this->companyMF;
|
||||
}
|
||||
|
||||
public function setCompanyMF(string $companyMF): static
|
||||
{
|
||||
$this->companyMF = $companyMF;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getPcName(): ?string
|
||||
{
|
||||
return $this->PcName;
|
||||
}
|
||||
|
||||
public function setPcName(string $PcName): static
|
||||
{
|
||||
$this->PcName = $PcName;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getUser(): ?User
|
||||
{
|
||||
return $this->user;
|
||||
}
|
||||
|
||||
public function setUser(?User $user): static
|
||||
{
|
||||
$this->user = $user;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getDisqueNom(): ?string
|
||||
{
|
||||
return $this->disqueNom;
|
||||
}
|
||||
|
||||
public function setDisqueNom(string $disqueNom): static
|
||||
{
|
||||
$this->disqueNom = $disqueNom;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getDisqueModel(): ?string
|
||||
{
|
||||
return $this->disqueModel;
|
||||
}
|
||||
|
||||
public function setDisqueModel(string $disqueModel): static
|
||||
{
|
||||
$this->disqueModel = $disqueModel;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getDisqueSerial(): ?string
|
||||
{
|
||||
return $this->disqueSerial;
|
||||
}
|
||||
|
||||
public function setDisqueSerial(string $disqueSerial): static
|
||||
{
|
||||
$this->disqueSerial = $disqueSerial;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getDateAdd(): ?\DateTimeInterface
|
||||
{
|
||||
return $this->dateAdd;
|
||||
}
|
||||
|
||||
public function getDateAddFormat($format): ?string
|
||||
{
|
||||
return $this->dateAdd->format($format);
|
||||
}
|
||||
|
||||
public function setDateAdd(\DateTimeInterface $dateAdd): static
|
||||
{
|
||||
$this->dateAdd = $dateAdd;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getStatu(): ?int
|
||||
{
|
||||
return $this->statu;
|
||||
}
|
||||
|
||||
public function setStatu(int $statu): static
|
||||
{
|
||||
$this->statu = $statu;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setStatuText(int $statu): ?string
|
||||
{
|
||||
if($this->statu == 0){
|
||||
return "En Attente";
|
||||
}elseif($this->statu == 1){
|
||||
return "Activer";
|
||||
}elseif($this->statu == 2){
|
||||
return "En Attente";
|
||||
}else{
|
||||
return "Erreur";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user