aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2014-02-28 20:22:50 +0100
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2014-02-28 20:22:50 +0100
commitf44683b5671b323ba96f0c4cd47ba9458e934679 (patch)
tree7dc93c1deecfc7f89212c5ba98d00ccbf98d6777 /app
parentd79da54c984fb4bb94bf4226d4318bfd408628db (diff)
API streamContents for categories and feeds
https://github.com/marienfressinaud/FreshRSS/issues/13
Diffstat (limited to 'app')
-rwxr-xr-xapp/Controllers/configureController.php2
-rw-r--r--app/Models/CategoryDAO.php6
-rw-r--r--app/Models/EntryDAO.php4
-rw-r--r--app/Models/FeedDAO.php6
4 files changed, 9 insertions, 9 deletions
diff --git a/app/Controllers/configureController.php b/app/Controllers/configureController.php
index f831f25d0..41a7920f0 100755
--- a/app/Controllers/configureController.php
+++ b/app/Controllers/configureController.php
@@ -44,7 +44,7 @@ class FreshRSS_configure_Controller extends Minz_ActionController {
'name' => $cat->name (),
);
- if ($catDAO->searchByName ($newCat) == false) {
+ if ($catDAO->searchByName ($newCat) == null) {
$catDAO->addCategory ($values);
}
}
diff --git a/app/Models/CategoryDAO.php b/app/Models/CategoryDAO.php
index 5355228a5..f3c02e3e4 100644
--- a/app/Models/CategoryDAO.php
+++ b/app/Models/CategoryDAO.php
@@ -64,7 +64,7 @@ class FreshRSS_CategoryDAO extends Minz_ModelPdo {
if (isset ($cat[0])) {
return $cat[0];
} else {
- return false;
+ return null;
}
}
public function searchByName ($name) {
@@ -80,7 +80,7 @@ class FreshRSS_CategoryDAO extends Minz_ModelPdo {
if (isset ($cat[0])) {
return $cat[0];
} else {
- return false;
+ return null;
}
}
@@ -120,7 +120,7 @@ class FreshRSS_CategoryDAO extends Minz_ModelPdo {
public function checkDefault () {
$def_cat = $this->searchById (1);
- if ($def_cat === false) {
+ if ($def_cat == null) {
$cat = new FreshRSS_Category (Minz_Translate::t ('default_category'));
$cat->_id (1);
diff --git a/app/Models/EntryDAO.php b/app/Models/EntryDAO.php
index b25ae444b..3fc7a05ef 100644
--- a/app/Models/EntryDAO.php
+++ b/app/Models/EntryDAO.php
@@ -307,7 +307,7 @@ class FreshRSS_EntryDAO extends Minz_ModelPdo {
$stm->execute ($values);
$res = $stm->fetchAll (PDO::FETCH_ASSOC);
$entries = self::daoToEntry ($res);
- return isset ($entries[0]) ? $entries[0] : false;
+ return isset ($entries[0]) ? $entries[0] : null;
}
public function searchById ($id) {
@@ -320,7 +320,7 @@ class FreshRSS_EntryDAO extends Minz_ModelPdo {
$stm->execute ($values);
$res = $stm->fetchAll (PDO::FETCH_ASSOC);
$entries = self::daoToEntry ($res);
- return isset ($entries[0]) ? $entries[0] : false;
+ return isset ($entries[0]) ? $entries[0] : null;
}
public function listWhere($type = 'a', $id = '', $state = 'all', $order = 'DESC', $limit = 1, $firstId = '', $filter = '', $date_min = 0, $keepHistoryDefault = 0) {
diff --git a/app/Models/FeedDAO.php b/app/Models/FeedDAO.php
index 79d8cff90..fb4a847a0 100644
--- a/app/Models/FeedDAO.php
+++ b/app/Models/FeedDAO.php
@@ -170,7 +170,7 @@ class FreshRSS_FeedDAO extends Minz_ModelPdo {
if (isset ($feed[$id])) {
return $feed[$id];
} else {
- return false;
+ return null;
}
}
public function searchByUrl ($url) {
@@ -186,7 +186,7 @@ class FreshRSS_FeedDAO extends Minz_ModelPdo {
if (isset ($feed)) {
return $feed;
} else {
- return false;
+ return null;
}
}
@@ -198,7 +198,7 @@ class FreshRSS_FeedDAO extends Minz_ModelPdo {
return self::daoToFeed ($stm->fetchAll (PDO::FETCH_ASSOC));
}
- public function listCategoryNames() {
+ public function arrayCategoryNames() {
$sql = 'SELECT f.id, 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);