diff --git a/gateways/GatewayNews.php b/gateways/GatewayNews.php index 7850b92..977a62b 100644 --- a/gateways/GatewayNews.php +++ b/gateways/GatewayNews.php @@ -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) diff --git a/gateways/GatewaySources.php b/gateways/GatewaySources.php index e083181..c81e68e 100644 --- a/gateways/GatewaySources.php +++ b/gateways/GatewaySources.php @@ -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(); diff --git a/update/Appel.php b/update/Appel.php index 7e9045e..a7fb5be 100644 --- a/update/Appel.php +++ b/update/Appel.php @@ -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) {