résolution appelle de finction foireux

feature/afficheRox
maxime.point2 1 year ago
parent 64312ad5a6
commit bb971a6959

@ -21,7 +21,7 @@ class FluxGateway
public function addFluxBySrc(string $flux) public function addFluxBySrc(string $flux)
{ {
$query = 'INSERT INTO Flux VALUES (null,: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){ public function removeFlux(Flux $flux){

@ -135,7 +135,7 @@ class AdminControleur
if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['flux'])){ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['flux'])){
$articleModel = new ArticleModel(); $articleModel = new ArticleModel();
$fluxModel = new FluxModel(); $fluxModel = new FluxModel();
$articleModel->removeAticleIdFlux(intval($_POST['flux'])); $articleModel->removeArticleIdFlux(intval($_POST['flux']));
$fluxModel->removeFluxById(intval($_POST['flux'])); $fluxModel->removeFluxById(intval($_POST['flux']));
$_REQUEST['action'] = 'listFlux'; $_REQUEST['action'] = 'listFlux';
$this->init(); $this->init();

@ -66,4 +66,10 @@ class ArticleModel
$dicoFluxArticle = [$flux,$tabArticle]; $dicoFluxArticle = [$flux,$tabArticle];
return $dicoFluxArticle; 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);
}
} }

@ -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')); $gwFl = new FluxGateway(new Connection('mysql:host=londres.uca.local;dbname=dbrorossetto', 'rorossetto', 'tpphp'));
$pars = new Parser( $gwFl,$gwArt); $pars = new Parser( $gwFl,$gwArt);
var_dump($pars);
Loading…
Cancel
Save