diff options
| author | 2013-04-10 20:55:12 +0200 | |
|---|---|---|
| committer | 2013-04-10 20:55:12 +0200 | |
| commit | e6436444db9e1bcc13c02c132f327e80d6584df0 (patch) | |
| tree | 3e287f953981ab87106e50a32b355f71e6ed63c5 /app/models/Entry.php | |
| parent | 30890b3d15566dd087b8e6837b75d47b17ed93ed (diff) | |
Fix bug #49 : les flux sans auteur sont traités normalement désormais
Diffstat (limited to 'app/models/Entry.php')
| -rwxr-xr-x | app/models/Entry.php | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/app/models/Entry.php b/app/models/Entry.php index ae207069c..4c672bcf3 100755 --- a/app/models/Entry.php +++ b/app/models/Entry.php @@ -49,7 +49,11 @@ class Entry extends Model { return $this->title; } public function author () { - return $this->author; + if (is_null ($this->author)) { + return ''; + } else { + return $this->author; + } } public function content () { return $this->content; @@ -212,7 +216,7 @@ class Entry extends Model { class EntryDAO extends Model_pdo { public function addEntry ($valuesTmp) { - $sql = 'INSERT INTO entry(id, guid, title, author, content, link, date, is_read, is_favorite, is_public, id_feed, annotation, tags, lastUpdate) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)'; + $sql = 'INSERT INTO entry(id, guid, title, author, content, link, date, is_read, is_favorite, is_public, id_feed, lastUpdate) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)'; $stm = $this->bd->prepare ($sql); $values = array ( @@ -227,14 +231,14 @@ class EntryDAO extends Model_pdo { $valuesTmp['is_favorite'], $valuesTmp['is_public'], $valuesTmp['id_feed'], - $valuesTmp['annotation'], - $valuesTmp['tags'], $valuesTmp['lastUpdate'], ); if ($stm && $stm->execute ($values)) { return true; } else { + $info = $stm->errorInfo(); + Log::record ('SQL error : ' . $info[2], Log::ERROR); return false; } } @@ -261,6 +265,8 @@ class EntryDAO extends Model_pdo { if ($stm && $stm->execute ($values)) { return true; } else { + $info = $stm->errorInfo(); + Log::record ('SQL error : ' . $info[2], Log::ERROR); return false; } } @@ -274,6 +280,8 @@ class EntryDAO extends Model_pdo { if ($stm && $stm->execute ($values)) { return true; } else { + $info = $stm->errorInfo(); + Log::record ('SQL error : ' . $info[2], Log::ERROR); return false; } } @@ -286,6 +294,8 @@ class EntryDAO extends Model_pdo { if ($stm && $stm->execute ($values)) { return true; } else { + $info = $stm->errorInfo(); + Log::record ('SQL error : ' . $info[2], Log::ERROR); return false; } } @@ -298,6 +308,8 @@ class EntryDAO extends Model_pdo { if ($stm && $stm->execute ($values)) { return true; } else { + $info = $stm->errorInfo(); + Log::record ('SQL error : ' . $info[2], Log::ERROR); return false; } } @@ -323,6 +335,8 @@ class EntryDAO extends Model_pdo { if ($stm && $stm->execute ($values)) { return true; } else { + $info = $stm->errorInfo(); + Log::record ('SQL error : ' . $info[2], Log::ERROR); return false; } } @@ -339,6 +353,8 @@ class EntryDAO extends Model_pdo { if ($stm && $stm->execute ($values)) { return true; } else { + $info = $stm->errorInfo(); + Log::record ('SQL error : ' . $info[2], Log::ERROR); return false; } } @@ -356,6 +372,8 @@ class EntryDAO extends Model_pdo { if (isset ($entry[0])) { return $entry[0]; } else { + $info = $stm->errorInfo(); + Log::record ('SQL error : ' . $info[2], Log::ERROR); return false; } } |
