public function delete($feedId) { $feed = $this->feedsDao->getFeeds($_SESSION['user']['id'], $feedId)->fetch(); if (false !== $feed) { try { $this->feedsDao->delete($feed->id); } catch (\Exception $e) { } return; } $this->slim->response->setStatus(403); }
/** * Get all articles from feed by feedId, use ?previousId to get articles older * than the choosen article ID. */ public function get($feedId) { $previousId = $this->slim->request->get('previousId', null); $read = $this->slim->request->get('read', null); $feed = $this->feedsDao->getFeeds($_SESSION['user']['id'], $feedId)->fetch(); if (false !== $feed) { $articles = $this->articlesDao->getPagedArticles($feedId, $previousId, $read)->fetchAll(); echo json_encode($articles); exit; } $this->slim->response->setStatus(403); }
public function get() { $this->slim->render('layout.twig', ['feeds' => $this->feedsDao->getFeeds($_SESSION['user']['id'])->fetchAll()]); }