diff options
| author | 2014-03-02 11:54:52 +0100 | |
|---|---|---|
| committer | 2014-03-02 11:54:52 +0100 | |
| commit | 00774f5a0bf2eacbb1825ccbf07e3fbc7b114b4d (patch) | |
| tree | 061fd7ee3f91e11a6b302e22b50a432eac7794bd /app/Models/FeedDAO.php | |
| parent | 3e7d14ccea6e3805d0e5eb8863c01946d980607d (diff) | |
API : SQL optimisation WHERE ... IN, and better compatibility EasyRSS
https://github.com/marienfressinaud/FreshRSS/issues/13
Diffstat (limited to 'app/Models/FeedDAO.php')
| -rw-r--r-- | app/Models/FeedDAO.php | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/app/Models/FeedDAO.php b/app/Models/FeedDAO.php index f9e1ad9e8..ca25c3aeb 100644 --- a/app/Models/FeedDAO.php +++ b/app/Models/FeedDAO.php @@ -198,15 +198,18 @@ class FreshRSS_FeedDAO extends Minz_ModelPdo { return self::daoToFeed ($stm->fetchAll (PDO::FETCH_ASSOC)); } - public function arrayCategoryNames() { - $sql = 'SELECT f.id, c.name as c_name FROM `' . $this->prefix . 'feed` f ' + public function arrayFeedCategoryNames() { //For API + $sql = 'SELECT f.id, f.name, c.name as c_name FROM `' . $this->prefix . 'feed` f ' . 'INNER JOIN `' . $this->prefix . 'category` c ON c.id = f.category'; $stm = $this->bd->prepare ($sql); $stm->execute (); $res = $stm->fetchAll(PDO::FETCH_ASSOC); $feedCategoryNames = array(); foreach ($res as $line) { - $feedCategoryNames[$line['id']] = $line['c_name']; + $feedCategoryNames[$line['id']] = array( + 'name' => $line['name'], + 'c_name' => $line['c_name'], + ); } return $feedCategoryNames; } |
