From bb971a695913a5d03f67052181b7defbd7d9bad4 Mon Sep 17 00:00:00 2001 From: "maxime.point2" Date: Sat, 18 Nov 2023 23:20:10 +0100 Subject: [PATCH] =?UTF-8?q?r=C3=A9solution=20appelle=20de=20finction=20foi?= =?UTF-8?q?reux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fluxRSS/src/DAL/FluxGateway.php | 2 +- fluxRSS/src/controleur/AdminControleur.php | 2 +- fluxRSS/src/model/ArticleModel.php | 6 ++++++ fluxRSS/src/test/test.php | 1 + 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/fluxRSS/src/DAL/FluxGateway.php b/fluxRSS/src/DAL/FluxGateway.php index 3675a06..f0469b8 100755 --- a/fluxRSS/src/DAL/FluxGateway.php +++ b/fluxRSS/src/DAL/FluxGateway.php @@ -21,7 +21,7 @@ class FluxGateway public function addFluxBySrc(string $flux) { $query = 'INSERT INTO Flux VALUES (null,:flux);'; - var_dump($this->con->executeQuery($query, array(':flux' => array($flux, PDO::PARAM_STR)))); + $this->con->executeQuery($query, array(':flux' => array($flux, PDO::PARAM_STR))); } public function removeFlux(Flux $flux){ diff --git a/fluxRSS/src/controleur/AdminControleur.php b/fluxRSS/src/controleur/AdminControleur.php index 9d8cadd..2a522c3 100755 --- a/fluxRSS/src/controleur/AdminControleur.php +++ b/fluxRSS/src/controleur/AdminControleur.php @@ -135,7 +135,7 @@ class AdminControleur if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['flux'])){ $articleModel = new ArticleModel(); $fluxModel = new FluxModel(); - $articleModel->removeAticleIdFlux(intval($_POST['flux'])); + $articleModel->removeArticleIdFlux(intval($_POST['flux'])); $fluxModel->removeFluxById(intval($_POST['flux'])); $_REQUEST['action'] = 'listFlux'; $this->init(); diff --git a/fluxRSS/src/model/ArticleModel.php b/fluxRSS/src/model/ArticleModel.php index 0da42c6..aecdbe7 100755 --- a/fluxRSS/src/model/ArticleModel.php +++ b/fluxRSS/src/model/ArticleModel.php @@ -66,4 +66,10 @@ class ArticleModel $dicoFluxArticle = [$flux,$tabArticle]; return $dicoFluxArticle; } + + public static function removeArticleIdFlux(int $idFlux) + { + $gwArticle = new ArticleGateway(new Connection('mysql:host=londres.uca.local;dbname=dbrorossetto','rorossetto','tpphp')); + $gwArticle->removeAllArticleFromFlux($idFlux); + } } \ No newline at end of file diff --git a/fluxRSS/src/test/test.php b/fluxRSS/src/test/test.php index ff5c34a..068db67 100755 --- a/fluxRSS/src/test/test.php +++ b/fluxRSS/src/test/test.php @@ -11,3 +11,4 @@ $gwArt = new ArticleGateway(new Connection('mysql:host=londres.uca.local;dbname= $gwFl = new FluxGateway(new Connection('mysql:host=londres.uca.local;dbname=dbrorossetto', 'rorossetto', 'tpphp')); $pars = new Parser( $gwFl,$gwArt); +var_dump($pars); \ No newline at end of file