<?phpnamespace App\Entity\Person;use App\Entity\Person;use App\Repository\Person\ReferrerRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;/** * @ORM\Entity(repositoryClass=ReferrerRepository::class) */class Referrer{ /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="string", length=255) */ private $ineKey; /** * @ORM\Column(type="string", length=1024) */ private $fullName; /** * @ORM\OneToMany(targetEntity=Person::class, mappedBy="referrer") */ private $referrals; public function __construct() { $this->referrals = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getIneKey(): ?string { return $this->ineKey; } public function setIneKey(string $ineKey): self { $this->ineKey = $ineKey; return $this; } public function getFullName(): ?string { return $this->fullName; } public function setFullName(string $fullName): self { $this->fullName = $fullName; return $this; } /** * @return Collection<int, Person> */ public function getReferrals(): Collection { return $this->referrals; } public function addReferral(Person $referral): self { if (!$this->referrals->contains($referral)) { $this->referrals[] = $referral; $referral->setReferrer($this); } return $this; } public function removeReferral(Person $referral): self { if ($this->referrals->removeElement($referral)) { // set the owning side to null (unless already changed) if ($referral->getReferrer() === $this) { $referral->setReferrer(null); } } return $this; }}