public function obterReservas() { $reservas = array(); $sql = "SELECT id_reserva, nome, email, diarias, quant_pessoas, valor_total, valor_diaria\r\n\t\t\tFROM reservas"; foreach ($this->con->query($sql) as $linha) { $reserva = new Reserva($linha['nome'], $linha['email'], $linha['diarias'], $linha['quant_pessoas'], $linha['valor_total'], $linha['valor_diaria']); $reserva->setId_reserva($linha['id_reserva']); $reservas[] = $reserva; } return $reservas; }