예제 #1
0
 public static function create($name, $url)
 {
     $db = db_connect();
     $query = $db->prepare("INSERT INTO rss_channel(name, url) VALUES(?, ?);");
     $query->execute(array($name, $url));
     return RSSChannel::get($db->lastInsertId());
 }
 public function handle_get()
 {
     if (!empty($_GET['action']) and $_GET['action'] == "delete" and !empty($_GET['id'])) {
         $feed = RSSChannel::get($_GET['id']);
         if ($feed) {
             $feed->delete();
         }
         $this->redirect(ROOT_URL . "admin/");
     }
 }