<?php
namespace App\Entity;
use App\Repository\VariablesRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: VariablesRepository::class)]
class Variables
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column()]
private ?int $id = null;
#[ORM\Column(length: 255)]
private ?string $nom = null;
#[ORM\Column(length: 20)]
private ?string $code = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $description = null;
#[ORM\ManyToOne(inversedBy: 'variables')]
private ?Categories $Categorie = null;
#[ORM\Column]
private ?int $status = null;
#[ORM\Column(length: 100, nullable: true)]
private ?string $typehtml = null;
#[ORM\OneToMany(mappedBy: 'variable', targetEntity: VariableConstants::class)]
private Collection $variableConstants;
#[ORM\OneToMany(mappedBy: 'variable', targetEntity: VehiculeVariable::class)]
private Collection $vehicule;
public function __construct()
{
$this->variableConstants = new ArrayCollection();
$this->vehicule = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getNom(): ?string
{
return $this->nom;
}
public function setNom(string $nom): self
{
$this->nom = $nom;
return $this;
}
public function getCode(): ?string
{
return $this->code;
}
public function setCode(string $code): self
{
$this->code = $code;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): self
{
$this->description = $description;
return $this;
}
public function getCategorie(): ?Categories
{
return $this->Categorie;
}
public function setCategorie(?Categories $Categorie): self
{
$this->Categorie = $Categorie;
return $this;
}
public function getStatus(): ?int
{
return $this->status;
}
public function setStatus(int $status): self
{
$this->status = $status;
return $this;
}
public function getTypehtml(): ?string
{
return $this->typehtml;
}
public function setTypehtml(?string $typehtml): self
{
$this->typehtml = $typehtml;
return $this;
}
/**
* @return Collection<int, VariableConstants>
*/
public function getVariableConstants(): Collection
{
return $this->variableConstants;
}
public function addVariableConstant(VariableConstants $variableConstant): self
{
if (!$this->variableConstants->contains($variableConstant)) {
$this->variableConstants[] = $variableConstant;
$variableConstant->setVariable($this);
}
return $this;
}
public function removeVariableConstant(VariableConstants $variableConstant): self
{
if ($this->variableConstants->removeElement($variableConstant)) {
// set the owning side to null (unless already changed)
if ($variableConstant->getVariable() === $this) {
$variableConstant->setVariable(null);
}
}
return $this;
}
/**
* @return Collection<int, VehiculeVariable>
*/
public function getVehicule(): Collection
{
return $this->vehicule;
}
public function addVehicule(VehiculeVariable $vehicule): self
{
if (!$this->vehicule->contains($vehicule)) {
$this->vehicule[] = $vehicule;
$vehicule->setVariable($this);
}
return $this;
}
public function removeVehicule(VehiculeVariable $vehicule): self
{
if ($this->vehicule->removeElement($vehicule)) {
// set the owning side to null (unless already changed)
if ($vehicule->getVariable() === $this) {
$vehicule->setVariable(null);
}
}
return $this;
}
}