listImages = array(); $this->queryImages = "SELECT id_imagen, url_imagen, nombre_lugar FROM galeria_lugar"; } public function getGalery($id_place) : array { $this->queryImages = "$this->queryImages WHERE id_lugar = $id_place;"; $this->listImages = array(); try { $acc = new DataAccess(); $results = $acc->executeQueryGet($this->queryImages); if (!$results->num_rows) { return ["message" => "No data"]; } while ($row = $results->fetch_assoc()) { array_push($this->listImages, new ImageGalery($row["id_imagen"], $row["url_imagen"], $row["nombre_lugar"])); } $acc->closeConection(); $acc = null; return $this->listImages; } catch (\Throwable $th) { return ["message" => "Error al optener los datos"]; } } }