<?php
namespace App\Entity;
use App\Repository\DepartmentRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: DepartmentRepository::class)]
class Department
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private ?int $id;
#[ORM\Column(type: 'string', length: 180)]
private ?string $name;
#[ORM\Column(type: 'string', length: 255)]
private ?string $description;
#[ORM\Column(type: 'boolean', nullable: true)]
private ?bool $isDeleted;
#[ORM\ManyToMany(targetEntity: ProfessionGroup::class)]
#[ORM\JoinTable(name: 'departments_profession_groups')]
private $professionGroups;
public function __construct()
{
$this->professionGroups = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(string $description): self
{
$this->description = $description;
return $this;
}
public function isIsDeleted(): ?bool
{
return $this->isDeleted;
}
public function setIsDeleted(?bool $isDeleted): self
{
$this->isDeleted = $isDeleted;
return $this;
}
/**
* @return Collection<int, ProfessionGroup>
*/
public function getProfessionGroups(): Collection
{
return $this->professionGroups;
}
public function addProfessionGroup(ProfessionGroup $professionGroup): self
{
if (!$this->professionGroups->contains($professionGroup)) {
$this->professionGroups[] = $professionGroup;
}
return $this;
}
public function removeProfessionGroup(ProfessionGroup $professionGroup): self
{
$this->professionGroups->removeElement($professionGroup);
return $this;
}
}