public function __toString() { if ($this->getNombre() === $this->municipio->getNombre()) { return "{$this->municipio->getNombre()}, {$this->municipio->getDepartamento()->getNombre()}"; } return "{$this->nombre} - {$this->municipio->getNombre()}, {$this->municipio->getDepartamento()->getNombre()}"; }