You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
746 B
24 lines
746 B
<?php
|
|
|
|
namespace model;
|
|
|
|
use DAL\{AdminGateway, ArticleGateway, Connection};
|
|
use metier;
|
|
require ('../DAL/ArticleGateway.php');
|
|
require ('../DAL/Connection.php');
|
|
|
|
class ArticleModel
|
|
{
|
|
public static function getArticles() : array
|
|
{
|
|
$gwArticle = new ArticleGateway(new Connection('mysql:host= londres.uca.local ; dbname= dbrorossetto', 'rorossetto', 'tpphp'));
|
|
$tabArticle = array();
|
|
$res = $gwArticle->getAllArticles();
|
|
foreach($res as $row){
|
|
$tabArticle[] = new metier\Article($row['id'], $row['title'],$row['datePub'],$row['description'],$row['guid'],$row['link'],$row['mediaContent'],$row['provenance'] );
|
|
}
|
|
return $tabArticle;
|
|
}
|
|
}
|
|
|
|
var_dump(ArticleModel::getArticles()); |