From 39ac587a606b910e8934149ef9566101e8cc9065 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20M=C3=A9ndez?= <45081533+FerMdez@users.noreply.github.com> Date: Tue, 13 Apr 2021 18:41:44 +0200 Subject: [PATCH 1/3] Update film_dao.php --- panel_admin/includes/film_dao.php | 8 -------- 1 file changed, 8 deletions(-) diff --git a/panel_admin/includes/film_dao.php b/panel_admin/includes/film_dao.php index 70e24bc..d284f29 100644 --- a/panel_admin/includes/film_dao.php +++ b/panel_admin/includes/film_dao.php @@ -51,14 +51,6 @@ return $resul; } - //Returns a query to get all films descriptions. - public function descriptionFilmData(){ - $sql = sprintf( "SELECT description FROM film "); - $resul = mysqli_query($this->mysqli, $sql) or die ('Error into query database'); - - return $resul; - } - /* public function addFilm($films) { $resul = mysqli_query($this->mysqli, $this->createFilm($film.getId(), $film.getTittle(), $film.getDuration(), $film.getLanguage(), $film.getDescription())) or die ('Error into query database'); From 9f93a4de1749a5a98ab8dcc2d3ecbb279d8c9caf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20M=C3=A9ndez?= <45081533+FerMdez@users.noreply.github.com> Date: Tue, 13 Apr 2021 19:22:20 +0200 Subject: [PATCH 2/3] Update film_dao.php --- panel_admin/includes/film_dao.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/panel_admin/includes/film_dao.php b/panel_admin/includes/film_dao.php index d284f29..4720f0a 100644 --- a/panel_admin/includes/film_dao.php +++ b/panel_admin/includes/film_dao.php @@ -31,16 +31,16 @@ return $resul; } - //Returns a query to get All the films. + //Returns a query to get All the films. public function allFilmData(){ $sql = sprintf( "SELECT * FROM film "); $resul = mysqli_query($this->mysqli, $sql) or die ('Error into query database'); - + while($fila=mysqli_fetch_array($resul)){ - $films[] = $this->loadFilm($fila["id"], $fila["tittle"], $fila["duration"], $fila["language"], $fila["description"]); + $films[] = $this->loadFilm($fila["id"], $fila["tittle"],$fila["duration"],$fila["language"],$fila["description"]); } - - return $resul; + + return $films; } //Returns a query to get all films tittles. From 99f3c33e5265758c59cac6da43b34d8c8b899cb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20M=C3=A9ndez?= <45081533+FerMdez@users.noreply.github.com> Date: Tue, 13 Apr 2021 19:27:26 +0200 Subject: [PATCH 3/3] Update film_dao.php --- panel_admin/includes/film_dao.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/panel_admin/includes/film_dao.php b/panel_admin/includes/film_dao.php index 4720f0a..49afc3f 100644 --- a/panel_admin/includes/film_dao.php +++ b/panel_admin/includes/film_dao.php @@ -79,8 +79,8 @@ } //Create a new film Data Transfer Object. - public function loadFilm($id, $tittle, $duration, $language){ - return new FilmDTO( $id, $tittle, $duration, $language); + public function loadFilm($id, $tittle, $duration, $language, $description){ + return new Film_DTO( $id, $tittle, $duration, $language, $description ); } }