From 0426541acbeb44d240e6dbf7a93f3a104bea61b4 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Mon, 22 Oct 2012 18:00:13 +0200 Subject: Grosse màj : ajout de la configuration + ajouts divers fonctionnalités MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/Entry.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'app/models/Entry.php') diff --git a/app/models/Entry.php b/app/models/Entry.php index 85e04cb4e..67d255c55 100755 --- a/app/models/Entry.php +++ b/app/models/Entry.php @@ -9,8 +9,9 @@ class Entry extends Model { private $date; private $is_read; private $is_favorite; + private $feed; - public function __construct ($guid = '', $title = '', $author = '', $content = '', + public function __construct ($feed = '', $guid = '', $title = '', $author = '', $content = '', $link = '', $pubdate = 0, $is_read = false, $is_favorite = false) { $this->_guid ($guid); $this->_title ($title); @@ -20,6 +21,7 @@ class Entry extends Model { $this->_date ($pubdate); $this->_isRead ($is_read); $this->_isFavorite ($is_favorite); + $this->_feed ($feed); } public function id () { @@ -53,6 +55,14 @@ class Entry extends Model { public function isFavorite () { return $this->is_favorite; } + public function feed ($object = false) { + if ($object) { + $feedDAO = new FeedDAO (); + return $feedDAO->searchById ($this->feed); + } else { + return $this->feed; + } + } public function _guid ($value) { $this->guid = $value; @@ -78,6 +88,9 @@ class Entry extends Model { public function _isFavorite ($value) { $this->is_favorite = $value; } + public function _feed ($value) { + $this->feed = $value; + } } class EntryDAO extends Model_array { @@ -162,6 +175,7 @@ class HelperEntry { foreach ($listDAO as $key => $dao) { $list[$key] = new Entry ( + $dao['feed'], $dao['guid'], $dao['title'], $dao['author'], -- cgit v1.2.3