Beispiel #1
0
 function cleanRSS(RSS $rss)
 {
     $news = $rss->getNews();
     foreach ($news as $key => $value) {
         $q = $this->db->prepare('DELETE FROM nouvelle WHERE url= :url');
         $url = $value->getLink();
         $q->bindParam(':url', $url, PDO::PARAM_STR);
         try {
             $q->execute();
         } catch (PDOException $e) {
             echo "PDO Error :" . $e->getMessage();
         }
         if ($value->getImage()) {
             unlink($value->getImage());
         }
     }
 }