src/Entity/VariablesGroup.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\VariablesGroupRepository;
  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(repositoryClassVariablesGroupRepository::class)]
  9. class VariablesGroup
  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]
  18.     private ?int $ordre null;
  19.     #[ORM\Column(typeTypes::DATETIME_MUTABLE)]
  20.     private ?\DateTimeInterface $date_creation null;
  21.     #[ORM\Column(typeTypes::INTEGERoptions: ['default' => 1])]
  22.     private int $etat 1;
  23.     #[ORM\Column(typeTypes::BOOLEANnullabletrue)]
  24.     private ?bool $contact null;
  25.     #[ORM\Column(typeTypes::BOOLEANnullabletrue)]
  26.     private ?bool $objet null;
  27.     #[ORM\OneToMany(mappedBy'variable_group'targetEntityVariable::class, cascade: ['remove''persist'])]
  28.     private Collection $variables;
  29.     #[ORM\ManyToMany(targetEntityContactType::class, inversedBy'variablesGroups')]
  30.     private Collection $contact_group;
  31.     #[ORM\ManyToMany(targetEntityObjetType::class, inversedBy'variablesGroups')]
  32.     #[ORM\JoinTable(name'variables_group_objet_type')]
  33.     #[ORM\JoinColumn(name'variables_group_id'referencedColumnName'id'onDelete'CASCADE')]
  34.     #[ORM\InverseJoinColumn(name'objet_type_id'referencedColumnName'id'onDelete'CASCADE')]
  35.     private Collection $objet_group;
  36.     #[ORM\Column(nullabletrue)]
  37.     private ?bool $societe null;
  38.     #[ORM\Column(nullabletrue)]
  39.     private ?bool $utilisateur null;
  40.     #[ORM\ManyToOne(inversedBy'variablesGroups')]
  41.     private ?Document $document null;
  42.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  43.     private ?string $icone null;
  44.     #[ORM\Column(nullablefalse)]
  45.     private ?int $colonne null;
  46.     public function __construct()
  47.     {
  48.         $this->variables = new ArrayCollection();
  49.         $this->contact_group = new ArrayCollection();
  50.         $this->objet_group = new ArrayCollection();
  51.     }
  52.     public function getId(): ?int
  53.     {
  54.         return $this->id;
  55.     }
  56.     public function getLabel(): ?string
  57.     {
  58.         return $this->label;
  59.     }
  60.     public function setLabel(string $label): static
  61.     {
  62.         $this->label $label;
  63.         return $this;
  64.     }
  65.     public function getOrdre(): ?int
  66.     {
  67.         return $this->ordre;
  68.     }
  69.     public function setOrdre(int $ordre): static
  70.     {
  71.         $this->ordre $ordre;
  72.         return $this;
  73.     }
  74.     public function getDateCreation(): ?\DateTimeInterface
  75.     {
  76.         return $this->date_creation;
  77.     }
  78.     public function setDateCreation(\DateTimeInterface $date_creation): static
  79.     {
  80.         $this->date_creation $date_creation;
  81.         return $this;
  82.     }
  83.     /**
  84.      * @return Collection<int, Variable>
  85.      */
  86.     public function getVariables(): Collection
  87.     {
  88.         return $this->variables;
  89.     }
  90.     public function addVariable(Variable $variable): static
  91.     {
  92.         if (!$this->variables->contains($variable)) {
  93.             $this->variables->add($variable);
  94.             $variable->setVariableGroup($this);
  95.         }
  96.         return $this;
  97.     }
  98.     public function removeVariable(Variable $variable): static
  99.     {
  100.         if ($this->variables->removeElement($variable)) {
  101.             // set the owning side to null (unless already changed)
  102.             if ($variable->getVariableGroup() === $this) {
  103.                 $variable->setVariableGroup(null);
  104.             }
  105.         }
  106.         return $this;
  107.     }
  108.     /**
  109.      * @return Collection<int, ContactType>
  110.      */
  111.     public function getContactGroup(): Collection
  112.     {
  113.         return $this->contact_group;
  114.     }
  115.     public function addContactGroup(ContactType $contactGroupId): static
  116.     {
  117.         if (!$this->contact_group->contains($contactGroupId)) {
  118.             $this->contact_group->add($contactGroupId);
  119.         }
  120.         return $this;
  121.     }
  122.     public function removeContactGroup(ContactType $contactGroupId): static
  123.     {
  124.         $this->contact_group->removeElement($contactGroupId);
  125.         return $this;
  126.     }
  127.     /**
  128.      * @return Collection<int, ObjetType>
  129.      */
  130.     public function getObjetGroup(): Collection
  131.     {
  132.         return $this->objet_group;
  133.     }
  134.     public function addObjetGroup(ObjetType $objetGroup): static
  135.     {
  136.         if (!$this->objet_group->contains($objetGroup)) {
  137.             $this->objet_group->add($objetGroup);
  138.         }
  139.         return $this;
  140.     }
  141.     public function removeObjetGroup(ObjetType $objetGroup): static
  142.     {
  143.         $this->objet_group->removeElement($objetGroup);
  144.         return $this;
  145.     }
  146.     public function isSociete(): ?bool
  147.     {
  148.         return $this->societe;
  149.     }
  150.     public function setSociete(?bool $societe): static
  151.     {
  152.         $this->societe $societe;
  153.         return $this;
  154.     }
  155.     public function isUtilisateur(): ?bool
  156.     {
  157.         return $this->utilisateur;
  158.     }
  159.     public function setUtilisateur(?bool $utilisateur): static
  160.     {
  161.         $this->utilisateur $utilisateur;
  162.         return $this;
  163.     }
  164.     public function getDocument(): ?Document
  165.     {
  166.         return $this->document;
  167.     }
  168.     public function setDocument(?Document $document): static
  169.     {
  170.         $this->document $document;
  171.         return $this;
  172.     }
  173.     public function getColonne(): ?int
  174.     {
  175.         return $this->colonne;
  176.     }
  177.     public function setColonne(?int $colonne): static
  178.     {
  179.         $this->colonne $colonne;
  180.         return $this;
  181.     }
  182.     public function getEtat(): int
  183.     {
  184.         return $this->etat;
  185.     }
  186.     public function setEtat(int $etat): static
  187.     {
  188.         $this->etat $etat;
  189.         return $this;
  190.     }
  191.     public function isContact(): ?bool
  192.     {
  193.         return $this->contact;
  194.     }
  195.     public function setContact(?bool $contact): static
  196.     {
  197.         $this->contact $contact;
  198.         return $this;
  199.     }
  200.     public function isObjet(): ?bool
  201.     {
  202.         return $this->objet;
  203.     }
  204.     public function setObjet(?bool $objet): static
  205.     {
  206.         $this->objet $objet;
  207.         return $this;
  208.     }
  209.     public function getIcone(): ?string
  210.     {
  211.         return $this->icone;
  212.     }
  213.     public function setIcone(?string $icone): static
  214.     {
  215.         $this->icone $icone trim($icone) : null;
  216.         return $this;
  217.     }
  218. }