/** * Devuelve una lista de ids de las oficinas registradas * @return int[] */ public function toList() { $query = "SELECT * FROM `oficinas`"; try { $datos = $this->connection->read($query); if (!$datos) { throw new Exception("no se han encontrado resultados"); } else { for ($i = 0; $i < count($datos); $i++) { $ids[$i] = $datos[$i]["ID"]; } return $ids; } } catch (Exception $exception) { throw $exception; } }