<?phpnamespace App\Entity;use App\Repository\SedeRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;/** * @ORM\Entity(repositoryClass=SedeRepository::class) * @ORM\Table(name="sede") */class Sede{ /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="string", length=100, nullable=true) */ private $nombre; /** * @ORM\Column(type="string", length=500) */ private $direccion; /** * @ORM\Column(type="string", length=100) */ private $poblacion; /** * @ORM\Column(type="string", length=100) */ private $provincia; /** * @ORM\Column(type="string", length=15) */ private $telefono; /** * @ORM\OneToMany(targetEntity=NumeroSede::class, mappedBy="sede", orphanRemoval=true) */ private $numeroSedes; public function __construct() { $this->numeroSedes = new ArrayCollection(); } public function __toString(): string { return $this->getString(); } public function getString(): string { $string = $this->getDireccion(); $string .= $this->getNombre() ? ' (' . $this->getNombre() . ')' : null; return $string; } public function getId(): ?int { return $this->id; } public function getNombre(): ?string { return $this->nombre; } public function setNombre(?string $nombre): self { $this->nombre = $nombre; return $this; } public function getDireccion(): ?string { return $this->direccion; } public function setDireccion(string $direccion): self { $this->direccion = $direccion; return $this; } public function getPoblacion(): ?string { return $this->poblacion; } public function setPoblacion(string $poblacion): self { $this->poblacion = $poblacion; return $this; } public function getProvincia(): ?string { return $this->provincia; } public function setProvincia(string $provincia): self { $this->provincia = $provincia; return $this; } public function getTelefono(): ?string { return $this->telefono; } public function setTelefono(string $telefono): self { $this->telefono = $telefono; return $this; } /** * @return Collection<int, NumeroSede> */ public function getNumeroSedes(): Collection { return $this->numeroSedes; } public function addNumeroSede(NumeroSede $numeroSede): self { if (!$this->numeroSedes->contains($numeroSede)) { $this->numeroSedes[] = $numeroSede; $numeroSede->setSede($this); } return $this; } public function removeNumeroSede(NumeroSede $numeroSede): self { if ($this->numeroSedes->removeElement($numeroSede)) { // set the owning side to null (unless already changed) if ($numeroSede->getSede() === $this) { $numeroSede->setSede(null); } } return $this; }}