aboutsummaryrefslogtreecommitdiff
path: root/app/models/Feed.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2013-11-18 23:04:43 +0100
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2013-11-18 23:04:43 +0100
commite2d4f1a7214591a47a46272a7a62e320eea029ce (patch)
treebb028ce493c74247e771c623d0a3f13ca4981ec2 /app/models/Feed.php
parent082246d13f524aa646d5aedf49ae7e3b6c621d6c (diff)
SQL : identifiant entier automatique pour les catégories et les flux
Implémentation de https://github.com/marienfressinaud/FreshRSS/issues/262 La catégorie par défaut à le numéro 1. Les numéros de catégories et de flux sont automatiques (1, 2, 3...) L'installeur semble marcher.
Diffstat (limited to 'app/models/Feed.php')
-rw-r--r--app/models/Feed.php13
1 files changed, 4 insertions, 9 deletions
diff --git a/app/models/Feed.php b/app/models/Feed.php
index 549603664..46ba7bd47 100644
--- a/app/models/Feed.php
+++ b/app/models/Feed.php
@@ -1,9 +1,9 @@
<?php
class Feed extends Model {
- private $id = null;
+ private $id = 0;
private $url;
- private $category = '000000';
+ private $category = 1;
private $nbEntries = -1;
private $nbNotRead = -1;
private $entries = null;
@@ -26,11 +26,7 @@ class Feed extends Model {
}
public function id () {
- if(is_null($this->id)) {
- return small_hash ($this->url . Configuration::selApplication ());
- } else {
- return $this->id;
- }
+ return $this->id;
}
public function url () {
return $this->url;
@@ -323,11 +319,10 @@ class Feed extends Model {
class FeedDAO extends Model_pdo {
public function addFeed ($valuesTmp) {
- $sql = 'INSERT INTO ' . $this->prefix . 'feed (id, url, category, name, website, description, lastUpdate, priority, httpAuth, error, keep_history) VALUES(?, ?, ?, ?, ?, ?, ?, 10, ?, 0, 0)';
+ $sql = 'INSERT INTO ' . $this->prefix . 'feed (url, category, name, website, description, lastUpdate, priority, httpAuth, error, keep_history) VALUES(?, ?, ?, ?, ?, ?, 10, ?, 0, 0)';
$stm = $this->bd->prepare ($sql);
$values = array (
- $valuesTmp['id'],
substr($valuesTmp['url'], 0, 511),
$valuesTmp['category'],
substr($valuesTmp['name'], 0, 255),