src/Entity/Variable.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\VariableRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\DBAL\Types\Types;
  7. use Doctrine\ORM\Mapping as ORM;
  8. #[ORM\Entity(repositoryClassVariableRepository::class)]
  9. class Variable
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column]
  14.     private ?int $id null;
  15.     #[ORM\Column(length255)]
  16.     private ?string $label null;
  17.     #[ORM\Column(typeTypes::TEXT)]
  18.     private ?string $type null;
  19.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  20.     private ?string $valeur_possible null;
  21.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  22.     private ?string $valeur_defaut null;
  23.     #[ORM\Column(typeTypes::DATETIME_MUTABLE)]
  24.     private ?\DateTimeInterface $date_creation null;
  25.     #[ORM\ManyToOne(inversedBy'variables')]
  26.     private ?VariablesGroup $variable_group null;
  27.     #[ORM\OneToMany(mappedBy'variable'targetEntityVariableValue::class, cascade: ['remove''persist'])]
  28.     private Collection $variableValues;
  29.     #[ORM\Column(nullabletrue)]
  30.     private ?int $ordre null;
  31.     #[ORM\Column(length20nullabletrue)]
  32.     private ?string $unite null;
  33.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  34.     private ?string $config null;
  35.     #[ORM\ManyToOne(inversedBy'variables')]
  36.     private ?User $userr null;
  37.     public function __construct()
  38.     {
  39.         $this->variableValues = new ArrayCollection();
  40.     }
  41.     public function getId(): ?int
  42.     {
  43.         return $this->id;
  44.     }
  45.     public function getLabel(): ?string
  46.     {
  47.         return $this->label;
  48.     }
  49.     public function setLabel(string $label): static
  50.     {
  51.         $this->label $label;
  52.         return $this;
  53.     }
  54.     public function getType(): ?string
  55.     {
  56.         return $this->type;
  57.     }
  58.     public function setType(string $type): static
  59.     {
  60.         $this->type $type;
  61.         return $this;
  62.     }
  63.     public function getValeurPossible(): ?string
  64.     {
  65.         return $this->valeur_possible;
  66.     }
  67.     public function setValeurPossible(string $valeur_possible): static
  68.     {
  69.         $this->valeur_possible $valeur_possible;
  70.         return $this;
  71.     }
  72.     public function getValeurDefaut(): ?string
  73.     {
  74.         return $this->valeur_defaut;
  75.     }
  76.     public function setValeurDefaut(string $valeur_defaut): static
  77.     {
  78.         $this->valeur_defaut $valeur_defaut;
  79.         return $this;
  80.     }
  81.     public function getDateCreation(): ?\DateTimeInterface
  82.     {
  83.         return $this->date_creation;
  84.     }
  85.     public function setDateCreation(\DateTimeInterface $date_creation): static
  86.     {
  87.         $this->date_creation $date_creation;
  88.         return $this;
  89.     }
  90.     public function getVariableGroup(): ?VariablesGroup
  91.     {
  92.         return $this->variable_group;
  93.     }
  94.     public function setVariableGroup(?VariablesGroup $variable_group): static
  95.     {
  96.         $this->variable_group $variable_group;
  97.         return $this;
  98.     }
  99.     /**
  100.      * @return Collection<int, VariableValue>
  101.      */
  102.     public function getVariableValues(): Collection
  103.     {
  104.         return $this->variableValues;
  105.     }
  106.     public function addVariableValue(VariableValue $variableValue): static
  107.     {
  108.         if (!$this->variableValues->contains($variableValue)) {
  109.             $this->variableValues->add($variableValue);
  110.             $variableValue->setVariable($this);
  111.         }
  112.         return $this;
  113.     }
  114.     public function removeVariableValue(VariableValue $variableValue): static
  115.     {
  116.         if ($this->variableValues->removeElement($variableValue)) {
  117.             // set the owning side to null (unless already changed)
  118.             if ($variableValue->getVariable() === $this) {
  119.                 $variableValue->setVariable(null);
  120.             }
  121.         }
  122.         return $this;
  123.     }
  124.     public function getOrdre(): ?int
  125.     {
  126.         return $this->ordre;
  127.     }
  128.     public function setOrdre(?int $ordre): static
  129.     {
  130.         $this->ordre $ordre;
  131.         return $this;
  132.     }
  133.     public function getUnite(): ?string
  134.     {
  135.         return $this->unite;
  136.     }
  137.     public function setUnite(?string $unite): static
  138.     {
  139.         $this->unite $unite;
  140.         return $this;
  141.     }
  142.     public function getConfig(): ?string
  143.     {
  144.         return $this->config;
  145.     }
  146.     public function setConfig(?string $config): static
  147.     {
  148.         $this->config $config;
  149.         return $this;
  150.     }
  151.     public function getUserr(): ?User
  152.     {
  153.         return $this->userr;
  154.     }
  155.     public function setUserr(?User $userr): static
  156.     {
  157.         $this->userr $userr;
  158.         return $this;
  159.     }
  160. }