connexion in model modified

pull/3/head
Roxane ROSSETTO 1 year ago
parent 0540dc629b
commit 75bfeb5913

@ -9,6 +9,6 @@ $rep = __DIR__ . '/../';
//BD //BD
$base = 'sasa'; $base = 'dbrorossetto';
$login = ''; $login = 'rorossetto';
$mdp = ''; $mdp = 'tpphp';

@ -4,11 +4,13 @@ namespace model;
use DAL; use DAL;
use metier; use metier;
require_once "config/config.php";
class ArticleModel class ArticleModel
{ {
public static function getArticles() : array public static function getArticles() : array
{ {
$gwArticle = new DAL\ArticleGateway(new DAL\Connection('mysql:host = localhost; dbname = dbrorossetto', 'rorossetto', 'tpphp')); $gwArticle = new DAL\ArticleGateway(new DAL\Connection( $base, $login, $mdp));
$res = $gwArticle->getAllArticles(); $res = $gwArticle->getAllArticles();
foreach($res as $row){ foreach($res as $row){
$tabArticle[] = new metier\Article($row['id'], $row['title'],$row['datePub'],$row['description'],$row['guid'],$row['link'],$row['mediaContent'],$row['provenance'] ); $tabArticle[] = new metier\Article($row['id'], $row['title'],$row['datePub'],$row['description'],$row['guid'],$row['link'],$row['mediaContent'],$row['provenance'] );

@ -2,6 +2,8 @@
namespace model; namespace model;
require_once "config/config.php";
class FluxModel class FluxModel
{ {
private FluxGateway $gateway; private FluxGateway $gateway;

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save