aboutsummaryrefslogtreecommitdiff
path: root/app/Models/FeedDAO.php
diff options
context:
space:
mode:
authorGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2014-03-30 14:28:13 +0200
committerGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2014-03-30 14:28:13 +0200
commit779afe9c4ee00f8099a423e1fceee40197a90cfa (patch)
treeabfe8682ba0032711e0eba53eb615a248943a1bd /app/Models/FeedDAO.php
parent9ea3819402746d8425d4a608f2d5f3c0f5bc29fb (diff)
Import of articles is implemented!
- Remove massiveImportAction and addCategories from FeedController - Fix typo for some methods (camelCase) - addCategoryObject and addFeedObject return id if corresponding object already exists in DB - introduce addEntryObject. Return -1 if Entry already exist (in order to keep quite good performances) - Complete importArticles method Need some more tests + better performance
Diffstat (limited to 'app/Models/FeedDAO.php')
-rw-r--r--app/Models/FeedDAO.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/app/Models/FeedDAO.php b/app/Models/FeedDAO.php
index eac21df7e..b65ff4af0 100644
--- a/app/Models/FeedDAO.php
+++ b/app/Models/FeedDAO.php
@@ -29,7 +29,8 @@ class FreshRSS_FeedDAO extends Minz_ModelPdo {
// should not be aware about feed class
// Add feed only if we don't find it in DB
- if (!$this->searchByUrl($feed->url())) {
+ $feed_search = $this->searchByUrl($feed->url());
+ if (!$feed_search) {
$values = array(
'id' => $feed->id(),
'url' => $feed->url(),
@@ -50,7 +51,7 @@ class FreshRSS_FeedDAO extends Minz_ModelPdo {
return $id;
}
- return false;
+ return $feed_search->id();
}
public function updateFeed ($id, $valuesTmp) {