<?php
namespace App\Entity;
use App\Repository\RgpdExpertRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: RgpdExpertRepository::class)]
class RgpdExpert
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private $id;
#[ORM\Column(type: 'string', length: 255)]
private $name;
#[ORM\Column(type: 'string', length: 255)]
private $email;
#[ORM\OneToMany(mappedBy: 'RgpdExpert', targetEntity: AccountingFirm::class)]
private $accountingFirms;
public function __construct()
{
$this->accountingFirms = 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 getEmail(): ?string
{
return $this->email;
}
public function setEmail(string $email): self
{
$this->email = $email;
return $this;
}
/**
* @return Collection<int, AccountingFirm>
*/
public function getAccountingFirms(): Collection
{
return $this->accountingFirms;
}
public function addAccountingFirm(AccountingFirm $accountingFirm): self
{
if (!$this->accountingFirms->contains($accountingFirm)) {
$this->accountingFirms[] = $accountingFirm;
$accountingFirm->setRgpdExpert($this);
}
return $this;
}
public function removeAccountingFirm(AccountingFirm $accountingFirm): self
{
if ($this->accountingFirms->removeElement($accountingFirm)) {
// set the owning side to null (unless already changed)
if ($accountingFirm->getRgpdExpert() === $this) {
$accountingFirm->setRgpdExpert(null);
}
}
return $this;
}
}