diff options
| author | 2013-11-18 23:04:43 +0100 | |
|---|---|---|
| committer | 2013-11-18 23:04:43 +0100 | |
| commit | e2d4f1a7214591a47a46272a7a62e320eea029ce (patch) | |
| tree | bb028ce493c74247e771c623d0a3f13ca4981ec2 /app/models/Feed.php | |
| parent | 082246d13f524aa646d5aedf49ae7e3b6c621d6c (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.php | 13 |
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), |
