<?phpnamespace App\Entity;use App\Model\Entity;use App\Repository\FamilyRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: FamilyRepository::class)]class Family extends Entity{ #[ORM\Column(length: 255)] private ?string $name = null; #[ORM\OneToMany(mappedBy: 'family', targetEntity: Serie::class)] private Collection $series; #[ORM\OneToMany(mappedBy: 'family', targetEntity: Range::class)] private Collection $ranges; #[ORM\ManyToMany(targetEntity: Provider::class, mappedBy: 'families')] private Collection $providers; public function __construct(string $name = null) { $this->name = $name; $this->series = new ArrayCollection(); $this->ranges = new ArrayCollection(); $this->providers = new ArrayCollection(); } public function getName(): ?string { return $this->name; } public function setName(string $name): self { $this->name = $name; return $this; } /** * @return Collection<int, Serie> */ public function getSeries(): Collection { return $this->series; } public function addSeries(Serie $series): self { if (!$this->series->contains($series)) { $this->series->add($series); $series->setFamily($this); } return $this; } public function removeSeries(Serie $series): self { if ($this->series->removeElement($series)) { // set the owning side to null (unless already changed) if ($series->getFamily() === $this) { $series->setFamily(null); } } return $this; } /** * @return Collection<int, Range> */ public function getRanges(): Collection { return $this->ranges; } public function addRange(Range $range): self { if (!$this->ranges->contains($range)) { $this->ranges->add($range); $range->setFamily($this); } return $this; } public function removeRange(Range $range): self { if ($this->ranges->removeElement($range)) { // set the owning side to null (unless already changed) if ($range->getFamily() === $this) { $range->setFamily(null); } } return $this; } /** * @return Collection<int, Provider> */ public function getProviders(): Collection { return $this->providers; } public function addProvider(Provider $provider): self { if (!$this->providers->contains($provider)) { $this->providers->add($provider); $provider->addFamily($this); } return $this; } public function removeProvider(Provider $provider): self { if ($this->providers->removeElement($provider)) { $provider->removeFamily($this); } return $this; } public function __toString(): string { return $this->name; }}