<?php
namespace App\Entity;
use App\Repository\ProjectTypeRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: ProjectTypeRepository::class)]
class ProjectType
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255)]
private ?string $label = null;
#[ORM\ManyToOne(inversedBy: 'projectTypes')]
private ?ContactType $contact_group = null;
#[ORM\ManyToMany(targetEntity: VariablesGroup::class, mappedBy: 'project_group')]
private Collection $variablesGroups;
#[ORM\OneToMany(mappedBy: 'project_type', targetEntity: Project::class)]
private Collection $projects;
#[ORM\Column(nullable: true)]
private ?int $colonne = null;
#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]
private ?\DateTimeInterface $date_creation = null;
public function __construct()
{
$this->variablesGroups = new ArrayCollection();
$this->projects = 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 getContactGroup(): ?ContactType
{
return $this->contact_group;
}
public function setContactGroup(?ContactType $contact_group): static
{
$this->contact_group = $contact_group;
return $this;
}
/**
* @return Collection<int, VariablesGroup>
*/
public function getVariablesGroups(): Collection
{
return $this->variablesGroups;
}
public function addVariablesGroup(VariablesGroup $variablesGroup): static
{
if (!$this->variablesGroups->contains($variablesGroup)) {
$this->variablesGroups->add($variablesGroup);
$variablesGroup->addProjectGroup($this);
}
return $this;
}
public function removeVariablesGroup(VariablesGroup $variablesGroup): static
{
if ($this->variablesGroups->removeElement($variablesGroup)) {
$variablesGroup->removeProjectGroup($this);
}
return $this;
}
/**
* @return Collection<int, Project>
*/
public function getProjects(): Collection
{
return $this->projects;
}
public function addProject(Project $project): static
{
if (!$this->projects->contains($project)) {
$this->projects->add($project);
$project->setProjectType($this);
}
return $this;
}
public function removeProject(Project $project): static
{
if ($this->projects->removeElement($project)) {
// set the owning side to null (unless already changed)
if ($project->getProjectType() === $this) {
$project->setProjectType(null);
}
}
return $this;
}
public function getColonne(): ?int
{
return $this->colonne;
}
public function setColonne(?int $colonne): static
{
$this->colonne = $colonne;
return $this;
}
public function getDateCreation(): ?\DateTimeInterface
{
return $this->date_creation;
}
public function setDateCreation(?\DateTimeInterface $date_creation): static
{
$this->date_creation = $date_creation;
return $this;
}
}