diff options
| author | 2014-03-30 14:28:13 +0200 | |
|---|---|---|
| committer | 2014-03-30 14:28:13 +0200 | |
| commit | 779afe9c4ee00f8099a423e1fceee40197a90cfa (patch) | |
| tree | abfe8682ba0032711e0eba53eb615a248943a1bd /app/Models/CategoryDAO.php | |
| parent | 9ea3819402746d8425d4a608f2d5f3c0f5bc29fb (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/CategoryDAO.php')
| -rw-r--r-- | app/Models/CategoryDAO.php | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/app/Models/CategoryDAO.php b/app/Models/CategoryDAO.php index 8be732b98..6a9b839b9 100644 --- a/app/Models/CategoryDAO.php +++ b/app/Models/CategoryDAO.php @@ -19,7 +19,8 @@ class FreshRSS_CategoryDAO extends Minz_ModelPdo { } public function addCategoryObject($category) { - if (!$this->searchByName($category->name())) { + $cat = $this->searchByName($category->name()); + if (!$cat) { // Category does not exist yet in DB so we add it before continue $values = array( 'name' => $category->name(), @@ -27,7 +28,7 @@ class FreshRSS_CategoryDAO extends Minz_ModelPdo { return $this->addCategory($values); } - return false; + return $cat->id(); } public function updateCategory ($id, $valuesTmp) { |
