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.
Php_RSS/fluxRSS/model/ArticleModel.php

24 lines
671 B

<?php
namespace model;
use DAL\{ArticleGateway, Connection};
use Exception;
use metier\Article;
class ArticleModel
{
/**
* @throws Exception
*/
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 Article($row['id'], $row['title'],$row['datePub'],$row['description'],$row['guid'],$row['link'],$row['mediaContent'],$row['provenance'] );
}
return $tabArticle;
}
}