<?php
namespace App\Entity;
use App\Repository\VariablesGroupRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: VariablesGroupRepository::class)]
class VariablesGroup
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255)]
private ?string $label = null;
#[ORM\Column]
private ?int $ordre = null;
#[ORM\Column(type: Types::DATETIME_MUTABLE)]
private ?\DateTimeInterface $date_creation = null;
#[ORM\OneToMany(mappedBy: 'variable_group', targetEntity: Variable::class, cascade: ['remove', 'persist'])]
private Collection $variables;
#[ORM\ManyToMany(targetEntity: ContactType::class, inversedBy: 'variablesGroups')]
private Collection $contact_group;
#[ORM\ManyToMany(targetEntity: ProjectType::class, inversedBy: 'variablesGroups')]
private Collection $project_group;
#[ORM\Column(nullable: true)]
private ?bool $societe = null;
#[ORM\Column(nullable: true)]
private ?bool $utilisateur = null;
#[ORM\ManyToOne(inversedBy: 'variablesGroups')]
private ?Document $document = null;
#[ORM\Column(nullable: false)]
private ?int $colonne = null;
public function __construct()
{
$this->variables = new ArrayCollection();
$this->contact_group = new ArrayCollection();
$this->project_group = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getLabel(): ?string
{
return $this->label;
}
public function setLabel(string $label): static
{
$this->label = $label;
return $this;
}
public function getOrdre(): ?int
{
return $this->ordre;
}
public function setOrdre(int $ordre): static
{
$this->ordre = $ordre;
return $this;
}
public function getDateCreation(): ?\DateTimeInterface
{
return $this->date_creation;
}
public function setDateCreation(\DateTimeInterface $date_creation): static
{
$this->date_creation = $date_creation;
return $this;
}
/**
* @return Collection<int, Variable>
*/
public function getVariables(): Collection
{
return $this->variables;
}
public function addVariable(Variable $variable): static
{
if (!$this->variables->contains($variable)) {
$this->variables->add($variable);
$variable->setVariableGroup($this);
}
return $this;
}
public function removeVariable(Variable $variable): static
{
if ($this->variables->removeElement($variable)) {
// set the owning side to null (unless already changed)
if ($variable->getVariableGroup() === $this) {
$variable->setVariableGroup(null);
}
}
return $this;
}
/**
* @return Collection<int, ContactType>
*/
public function getContactGroup(): Collection
{
return $this->contact_group;
}
public function addContactGroup(ContactType $contactGroupId): static
{
if (!$this->contact_group->contains($contactGroupId)) {
$this->contact_group->add($contactGroupId);
}
return $this;
}
public function removeContactGroup(ContactType $contactGroupId): static
{
$this->contact_group->removeElement($contactGroupId);
return $this;
}
/**
* @return Collection<int, ProjectType>
*/
public function getProjectGroup(): Collection
{
return $this->project_group;
}
public function addProjectGroup(ProjectType $projectGroup): static
{
if (!$this->project_group->contains($projectGroup)) {
$this->project_group->add($projectGroup);
}
return $this;
}
public function removeProjectGroup(ProjectType $projectGroup): static
{
$this->project_group->removeElement($projectGroup);
return $this;
}
public function isSociete(): ?bool
{
return $this->societe;
}
public function setSociete(?bool $societe): static
{
$this->societe = $societe;
return $this;
}
public function isUtilisateur(): ?bool
{
return $this->utilisateur;
}
public function setUtilisateur(?bool $utilisateur): static
{
$this->utilisateur = $utilisateur;
return $this;
}
public function getDocument(): ?Document
{
return $this->document;
}
public function setDocument(?Document $document): static
{
$this->document = $document;
return $this;
}
public function getColonne(): ?int
{
return $this->colonne;
}
public function setColonne(?int $colonne): static
{
$this->colonne = $colonne;
return $this;
}
}