master
Bastien OLLIER 2 years ago
parent bb10ade08e
commit 809df618a8

@ -16,7 +16,7 @@ class GatewayNews
':pubdate' => array(date("Y-m-d H:i:s", strtotime($news->getPubdate())), PDO::PARAM_STR),
':link' => array($news->getLink(), PDO::PARAM_STR)
)
);
);
}
public function getNews($page,$nbArticlePage)

@ -25,7 +25,7 @@ class GatewaySources
public function getSources()
{
$query = "SELECT * FROM sources";
$query = "SELECT * FROM sources order by id desc";
$this->con->executeQuery($query, array());
$results=$this->con->getResults();
$listeSources = array();

@ -10,11 +10,14 @@ class Appel{
$gatewaySource = new GatewaySources(new Connection($dsn, $user, $pass));
$listeSources = $gatewaySource->getSources();
foreach ($listeSources as $source) {
$resultFlux = $parser->getResultFlux($source->getLink());
foreach ($resultFlux as $n) {
$gatewayNew->addNews($n);
}
}
} catch (Exception $e) {

Loading…
Cancel
Save