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.
19 lines
578 B
19 lines
578 B
<?php
|
|
|
|
namespace model;
|
|
|
|
use DAL\{ArticleGateway,Connection};
|
|
use metier;
|
|
|
|
class ArticleModel
|
|
{
|
|
public static function getArticles() : array
|
|
{
|
|
$gwArticle = new ArticleGateway(new Connection('mysql:host = localhost; dbname = dbmapoint2', 'mapoint2', 'Overmax0'));
|
|
$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;
|
|
}
|
|
} |