<?phpnamespace App\Entity;use App\Repository\SectionRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;/** * @ORM\Entity(repositoryClass=SectionRepository::class) */class Section{ /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="string", length=255) */ private $number; /** * @ORM\OneToMany(targetEntity=Person::class, mappedBy="section") */ private $persons; /** * @ORM\ManyToMany(targetEntity=Suburb::class, inversedBy="sections") */ private $suburbs; /** * @ORM\ManyToOne(targetEntity=Route::class, inversedBy="sections") */ private $route; public function __construct() { $this->persons = new ArrayCollection(); $this->suburbs = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getNumber(): ?string { return $this->number; } public function setNumber(string $number): self { $this->number = $number; return $this; } /** * @return Collection<int, Person> */ public function getPersons(): Collection { return $this->persons; } public function addPerson(Person $person): self { if (!$this->persons->contains($person)) { $this->persons[] = $person; $person->setSection($this); } return $this; } public function removePerson(Person $person): self { if ($this->persons->removeElement($person)) { // set the owning side to null (unless already changed) if ($person->getSection() === $this) { $person->setSection(null); } } return $this; } /** * @return Collection<int, Suburb> */ public function getSuburbs(): Collection { return $this->suburbs; } public function addSuburb(Suburb $suburb): self { if (!$this->suburbs->contains($suburb)) { $this->suburbs[] = $suburb; } return $this; } public function removeSuburb(Suburb $suburb): self { $this->suburbs->removeElement($suburb); return $this; } public function getRoute(): ?Route { return $this->route; } public function setRoute(?Route $route): self { $this->route = $route; return $this; }}