<?php
namespace App\Entity;
use App\Repository\CirExpertRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: CirExpertRepository::class)]
class CirExpert
{
#[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: 'cirExpert', targetEntity: AccountingFirm::class)]
private $accountingFirm;
public function __construct()
{
$this->accountingFirm = 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 getAccountingFirm(): Collection
{
return $this->accountingFirm;
}
public function addAccountingFirm(AccountingFirm $accountingFirm): self
{
if (!$this->accountingFirm->contains($accountingFirm)) {
$this->accountingFirm[] = $accountingFirm;
$accountingFirm->setCirExpert($this);
}
return $this;
}
public function removeAccountingFirm(AccountingFirm $accountingFirm): self
{
if ($this->accountingFirm->removeElement($accountingFirm)) {
// set the owning side to null (unless already changed)
if ($accountingFirm->getCirExpert() === $this) {
$accountingFirm->setCirExpert(null);
}
}
return $this;
}
}